Hi,
I am a new guy in jasper and iReport. I could create a report and subreport successfully with iReport. while running through iReport, it will ask for parameters and after supplying them, the report launches. I had writen a java class which accepts parameters from command prompt and put these into a hashmap. I could created a oracle db connection also which is working successfully. My problem is, while report is executing through java file, I am getting an empty page. But the same thing working fine for iReport. Please see below my code to fill the report and view it. view is working fine since I tried for an existing jrprint file by commenting fill fillReportToFile method, I can view the report.
Map phyIDMap = getPhysicianId();//fills with 3 values
System.out.println("Hashmap Size--->"+phyIDMap.size());
//filled Hashmap and open connection
JasperFillManager.fillReportToFile("C:/iReport-2.0.1/Working.jasper",phyIDMap,getConnection());
System.out.println("Saved the file into the directory.");
System.out.println("\nPlease wait.Report is loading ....");
JasperViewer.viewReport("C:/iReport-2.0.1/classic.jrprint", false);
closeConnection();//closing connection
System.out.println("Done!");
this is the section of the file which is filling and displaying report according to the values from command prompt. hashmap is filling with the correct values from command prompt. connection also true. And the phenomenon happend only for the reports which is expecting parameters. for static queries, I can successfully launch the report. I think the problem is in the code "JasperFillManager.fillReportToFile("C:/iReport-2.0.1/Working.jasper",phyIDMap,getConnection());" , filling is not happening in the case of reports with parameters(I guess). Please advice me what to do in this case. I searched a lot, but couldn't find anything helpful.
Thanks&Regards,
Rakesh