Dear all,
I hope you are doing good. I would like to know whether we can generate a jasper report in
java without using any database connection. I know we can generate jasper report in java with database connection. I have generated few reprts in .pdf and .xls format. Now I want to display some text on the the jasper report in java without database, say "hello jasper". I am using ireport. I have creaated a file and in that file, I have added a title in the title section $P{Report_title} . Now in the program, i am declaring a hashmap and trying put value in the hasmap like, hm.put("Report_title","Hello Report");
Later I am declaring JasperPrint like as follows.
JasperPrint print=JasperFillManager.fillReportToFile(fileName, outFileNamePDF, hm);
Here I am having problem about type mismatch:cannot convert from void to JasperPrint. I am not fully familiar with JasperReport API. I am trying to learn it with some simple examples first.In order to get the data on the report what I am supposed to do? Passing value from hashmap? Or shall use any collections? I would appreciate your suggestions. Thanks in advance. Please find the code. It's vary simple at the moment.
Best regards,