How to export JrPrint from jrxml through Java ?

0

Hi Jaspers Gurus ,

 

We have a requirement in our project to export jasper reports(.jrxml) to .jrprint fomat so that we can send the .jrprint files to client.Can you please help me by providing the java code through which we can take a jrxml or jasper as input parameter and export it to .jrprint format.

 

Please help.

saha.nabajyoti's picture
Joined: Aug 16 2013 - 6:10am
Last seen: 3 years 10 months ago

I wonder if would like to do the reverse, from a .jrprint mount a .jrxml

horacio

 

 

horaciox - 3 years 4 months ago

2 Answers:

1
 
<span style="font-size:11px;">JasperReport report = JasperCompileManager.compileReport( "MyFancyPantsReport.jrxml" );
// setup parameters for use with the report
HashMap<String, Object> params = new HashMap<String,Object>();
params.put( "sqlDate", fromDate );
 
// Fill the report data from the sql connection and parameters
JasperPrint myJRprintReportObject = JasperFillManager.fillReport(report, params, connection);
JRSaver.saveObject(jasperPrint, "build/reports/MyFancyPantsReport.jrprint");
 
</span>
marianol's picture
4728
Joined: Sep 13 2011 - 8:04am
Last seen: 1 year 2 weeks ago
1

Thank you..It worked...

saha.nabajyoti's picture
Joined: Aug 16 2013 - 6:10am
Last seen: 3 years 10 months ago
Feedback
randomness