Jump to content

Recommended Posts

Posted

Hi

I am using jasper reports 3.7.1 jar to generate report (PDF/XLS/TXT/HTML). first for around 100,000 records tomcat was going out of memory so I implement JRSwapFileVirtualizer in my code.

Now I am able to generate report within 4-5 minutes. Now I have 250,000 records and for this JRSwapFileVirtualizer is not working.

I have written a stand alone class and I am testing it with JRCsvDataSource. When I run it swap file is created of size 150MB, I waited for around 1 hour but jasper code didnt generate PDF report So I terminate the thread. It is not showing any exception right now.

My code  is as below-

            JRSwapFile jrSwapFile=new JRSwapFile("C:\Users\TEST\tempe",5000,100);        //5000, 100, 10 all these numbers are randomly taken.
            JRSwapFileVirtualizer swapFileVirtualizer=new JRSwapFileVirtualizer(10, jrSwapFile);
            customParameters.put(JRParameter.REPORT_VIRTUALIZER, swapFileVirtualizer);
            customParameters.put(JRParameter.IS_IGNORE_PAGINATION, false);

        JasperDesign jasperDesign = JRXmlLoader.load(ipPdfXmlLayout);                 //load jrxml file
        JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
        JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, customParameters, jasperDS);
        JasperExportManager.exportReportToPdfFile(jasperPrint, ipTxtFile.getPath()+".PDF");
        jasperDS.close();

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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