Jump to content
Changes to the Jaspersoft community edition download ×

Export Report To Pdf


2005 IR Help

Recommended Posts

By: roberto71 - roberto71

Export Report To Pdf

2004-12-01 23:51

When i use exportReportToPdf on JasperExportManager all works fine, so i have the byte[] result.

but when i write this byte[] in the outputstream in tha caller servler, Adobe PDF browser doens't start inside the browser; if i disable to start adobe pdf in browser instead, the reader starts.

 

in my servlet i have:

 

response.setContentType("application/pdf");

response.setContentLength(aPageData.length);

response.setBufferSize(aPageData.length);

response.getOutputStream().write(aPageData);

response.getOutputStream().flush();

 

where aPageData is the results of JasperExportManager.exportReportToPdf(aJasperPrint);

 

Using a byte[] generated from another report engine all works fine instead (with the same machine: Jboss 3.2.6, jdk 1.4.2_06, IE 6.0xx SP2)

 

Any idea ?

 

Thank You

 

 

 

 

By: Eu Gene - eglim

RE: Export Report To Pdf

2004-12-02 00:03

Why don't you use JasperExportManager.exportReportToPdfStream? It works for me.

 

JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());

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