469,963 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

Empty report appearing for iReport, when calling from a java class file.

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
Jan 11 '08 #1
0 3182

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Wayno | last post: by
3 posts views Thread by tornado | last post: by
reply views Thread by Neal | last post: by
2 posts views Thread by =?Utf-8?B?UXVpbWJseQ==?= | last post: by
reply views Thread by jebbyleezer | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.