Jump to content

Report fill and export to pdf very slow.


pankajnain87

Recommended Posts

I am creating a report in Jasper Studio. I am using XML datasource to fill the report. It takes 22 secs to fill the report using JasperStudio report preview feature but it takes 4 minutes to create pdf file on the server.

I am using .Net to fill report.

Below is the code sample which is used to fill report and export pdf.

pars.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);
                    pars.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, "yyyy-MM-dd");
                    pars.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, "#,##0.##");
                    pars.put(JRXPathQueryExecuterFactory.XML_LOCALE, Locale.ENGLISH);
                    
                    DefaultJasperReportsContext context = DefaultJasperReportsContext.getInstance();
                    JRPropertiesUtil.getInstance(context).setProperty("net.sf.jasperreports.xpath.executer.factory",
                        "net.sf.jasperreports.engine.util.xml.JaxenXPathExecuterFactory");
                    JasperFillManager jasperFillManager = JasperFillManager.getInstance(context);

                    JasperPrint jasperPrint = jasperFillManager.fill(report_path + template, pars);                    
                                     
                        JasperExportManager.exportReportToPdfFile(jasperPrint, saveLocation);                        
                    

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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