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

Splitting HTML Report into multiple files...


ktrinad

Recommended Posts

By: Jorn T. Nordahl - jorntnordahl

Splitting HTML Report into multiple files...

2004-11-15 10:35

I would like to be able to produce an html report that consists of multiple files, one per page, instead of the current 1 huge html file.

 

Is this possible?

 

 

By: lkaap - girishkm67

RE: Splitting HTML Report into multiple files...

2004-11-18 03:47

Just use this piece of code.... most of it is pretty clear. U will be generating a html file for each page.

Hope u find it useful

 

JRHtmlExporter exporter = new JRHtmlExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

 

for(int i=0;i<pageList.size();i++) {

String fileName = ((int)(Math.random()*100000))+".html";

fileNames.add(fileName);

}

 

 

for(int i=0;i<fileNames.size();i++) {

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, fileNames.get(i));

exporter.setParameter(JRExporterParameter.PAGE_INDEX,new Integer(i));

exporter.setParameter exporter.exportReport();

}

Link to comment
Share on other sites

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