vsmadhu Posted March 24, 2010 Share Posted March 24, 2010 Hi I have used the below method to export PDF report from a java program. it takes about 5 mins to return a 25 page report. iReports returns the results in like 15 to 20 Sec on the same machine the time in SOP before and after returned 5 min in JasperFillManager.fillReport Any idea why there is ssuch a huge differenece between iReport Exproting and Exproting from a java program ? public byte[] runReportForPDF(String passedFilePath, String reportName, String reportXpath, HashMap parameters,BufferedInputStream buff) throws JRException { JRXmlDataSource xmlDataSource = null; JasperPrint jprint = null; JasperReport jasperReport = null; InputStream inputStream = null; try{ System.out.println("Printing All METHOD_PARAMETER_VALUE PDF "+passedFilePath+" /"+reportName+" /"+reportXpath+" /"+parameters); xmlDataSource = getXMLDataSource(buff,reportXpath); passedFilePath = passedFilePath.concat(reportName); System.out.println(passedFilePath); inputStream = JRLoader.getLocationInputStream(passedFilePath); jasperReport = (JasperReport) JRLoader.loadObject(inputStream); System.out.println("Time Before Filling the PDF reprot "+ Calendar.getInstance().getTime()); jprint = JasperFillManager.fillReport(jasperReport,parameters, xmlDataSource); System.out.println("Time After Filling the PDF reprot "+ Calendar.getInstance().getTime()); /* * Closing all the connections/variables used*/ if (inputStream != null){ inputStream.close(); inputStream = null; } }catch(Exception e){ e.getLocalizedMessage(); e.printStackTrace(); } return ((byte[])JasperExportManager.exportReportToPdf(jprint)); } Post Edited by vsmadhu at 06/09/2010 17:50 Link to comment Share on other sites More sharing options...
vsmadhu Posted June 9, 2010 Author Share Posted June 9, 2010 Use of Jaxen jar instead of xalan solved the problem.Jaxen is also included in the jasper download.Change the value in jasperreports-(your-version).jarfile name default.jasperreports.propertiessearch fornet.sf.jasperreports.xpath.executer.factory=comment it (Just for backup)and add a new line likenet.sf.jasperreports.xpath.executer.factory=net.sf.jasperreports.engine.util.xml.JaxenXPathExecuterFactory Link to comment Share on other sites More sharing options...
lukassoftware Posted July 27, 2011 Share Posted July 27, 2011 i got an errorCaused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Class "net.sf.jasperreports.engine.util.xml.JaxenXPathExecuterFactory" should be compatible with "net.sf.jasperreports.engine.query.JRQueryExecuterFactory" what's my mistake ?can someone help meregards,Mathias 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