saha.nabajyoti Posted August 25, 2015 Share Posted August 25, 2015 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 More sharing options...
marianol Posted August 25, 2015 Share Posted August 25, 2015 Just straight form JasperReports API http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperPrint.html 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 More sharing options...
saha.nabajyoti Posted August 26, 2015 Author Share Posted August 26, 2015 Thank you..It worked... Link to comment Share on other sites More sharing options...
horaciox Posted May 27, 2016 Share Posted May 27, 2016 I wonder if would like to do the reverse, from a .jrprint mount a .jrxmlhoracio Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now