I have been working japer reports within java. I have developed a report using jdbc in ireport. Now, I want to execute this report within my java programme. I am exporting this report in a .pdf file using,
JasperPrint print = JasperFillManager.fillReport(jasperFileName, map, conn);
Now, here is a little trouble. I have already generated report in ireport including headers like Report generated by (name_from_database_at_the_runtime) process, (STEP_NAME_AT_RUN_TIME) step Profiled (TOTAL_COUNT_AT_RUN_TIME)records in (TABLE_NAME_AT_RUN_TIME) table. This is the header with some dynamic data present in parantheses at the run time. Therefore, I am writing a method to extract only data from the report and export it another method where I am prinitng header of the report. I need to write the query in order to getData() from the database. I would like to know when there are multiple row how should I use the hashmap with respect to connection? How should I map it? I would appreaciate your suggestions and ideas.
code of the method for writing data.
code for the getting data from the record.
Joined: Nov 03, 2009
got the solution by passing HashMap and connection through the method.