Jump to content
Changes to the Jaspersoft community edition download ×

pdf file is not opening in netscape


Recommended Posts

By: mandava - lakshmipmandava

pdf file is not opening in netscape

2002-07-18 07:31

when i am writing pdf file using using below code in JSP file

 

byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(),parameters,con);

 

// JasperRunManager.runReportToPdfFile(reportFile.getPath(),parameters,con);

 

 

// System.out.println("apth is : " +application.getRealPath("/SADI.jrprint"));

// JasperPrintManager.printReport("SADI.jrprint", true);

 

response.setContentType("application/pdf");

response.setContentLength(bytes.length);

 

ServletOutputStream ouputStream = response.getOutputStream();

ouputStream.write(bytes, 0, bytes.length);

ouputStream.flush();

ouputStream.close();

 

In netscape the pdf file is not opening, the stream of data is writing to the browser. The browser is saying that the document is damaged or corrupted. how can i overcome this problem.

 

 

 

By: Bart Cassady - bartong

RE: pdf file is not opening in netscape

2002-07-19 07:41

Don't close the output stream. The servlet container takes care of opening and closing it for you.

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