aspose file tools*
The moose likes Other Java Products and Servers and the fly likes How to display jasper report in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "How to display jasper report in jsp" Watch "How to display jasper report in jsp" New topic
Author

How to display jasper report in jsp

shankar valiinaykam
Greenhorn

Joined: Jan 21, 2005
Posts: 23
Hi,

How do I display jasper report in jsp?

<form name='reportform' method='POST'>
<%
JasperDesign jasperDesign = JRXmlLoader.load("C:\\apache-tomcat-5.5.17\\webapps\\ROOT\\redcals\\Edcal_report.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
Connection conn = new DBUtility().getConnection();
ByteArrayOutputStream baos =new ByteArrayOutputStream();
response.setContentType("application/pdf");
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, conn);
net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(jasperPrint,baos);
response.setContentLength(baos.size());
ServletOutputStream out1 = response.getOutputStream();
baos.writeTo(out1);
out1.flush();
conn.close();
%>
</form>

I am spinning wheels for whole day on this issue. Kindly help me.

Thanks,
Sankar
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Are you getting any errors?

You should remember that you required PDF plug-in installed and integrated with your browser to display PDF data.


My blood is tested +ve for Java.
shankar valiinaykam
Greenhorn

Joined: Jan 21, 2005
Posts: 23
I have pdf plug-in
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
are you getting any error?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to display jasper report in jsp
 
Similar Threads
JasperReport problem
Excel reporting through Jasperreports
opening a pdf file created by jasper in client side
unable to read file from war file
JasperReports + JSP