Jump to content
We've recently updated our Privacy Statement, available here ×

virtualizer file causing disc full


suryakantmandal

Recommended Posts

I am using JRFileVirtualizer to prepare the report but its creating thousands of temp files virt**** which is creating disc full problem on server.

I have called virtualizer.cleanup(); to clean the files created post the report has generated but this also not delteing the temp files.

Is there any way to get the names of temp files created so that I can ran manual cleanup matching those name before ending the process.

if(outputType.equals(OutputTypeEnum.EXCEL))
       {
          JasperFillManager jasperFillManager = JasperFillManager.getInstance(DefaultJasperReportsContext.getInstance());
          JasperPrint jasperPrint = jasperFillManager.fill(reportStream, parameterMap, connection);

          JRXlsExporter exporter = new JRXlsExporter();
         exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
         exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outputFilename);
         exporter.exportReport();
         result.setReportContent(FileUtils.readFileToByteArray(new File(outputFilename)));
         result.setOutputFile(new File(outputFilename));
       }

====

JRFileVirtualizer virtualizer = new JRFileVirtualizer(VIRTUAL_PAGE_SIZE, makeTempDirectory()); 
      parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);

 

Thanks,

Surya

Link to comment
Share on other sites

  • Replies 2
  • 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...