Jump to content
Changes to the Jaspersoft community edition download ×

How to export JrPrint from jrxml through Java ?


saha.nabajyoti

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic


 

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");


 

Link to comment
Share on other sites

  • 9 months later...

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...