Jump to content
We've recently updated our Privacy Statement, available here ×

ireport dynamic parameter passing through java


itzbobi

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

I am new to jasper report ..And I developed new jasper report using ireport.. in my report thre is one parameter. From ireport it taking the parameters and working fine. But when I calling it using java code it wont taking the parameters instead it produsing complete output without parameter..even it wont taking the default parameters which i hav asssinged in jasper report.

Code:

HashMap jasperParameter = new HashMap();  

               Map parameters = new HashMap();

               parameters.put("Pname","P");  

               JasperReport jasperReport = null;

               jasperReport=JasperCompileManager.compileReport(reportFile);  

               JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,new JRResultSetDataSource(result));  

               JasperExportManager.exportReportToPdfFile(jasperPrint,"E:\report3.pdf");  

 

JRXMl:

Code:
HashMap jasperParameter = new HashMap();                 		Map parameters = new HashMap();               		parameters.put("Pname","P");                 		JasperReport jasperReport = null;               		jasperReport=JasperCompileManager.compileReport(reportFile);                 		JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,new JRResultSetDataSource(result));                 		JasperExportManager.exportReportToPdfFile(jasperPrint,"E:\report3.pdf");  
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...