File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Jasper Report blank Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Jasper Report blank" Watch "Jasper Report blank" New topic
Author

Jasper Report blank

Sherryl Philip
Greenhorn

Joined: Jul 02, 2004
Posts: 20
Hi,
I have the following JSP page where I'm trying to view a report which is generated using the iReport tool. But when I try to generate the Report, the Report turns up with the template and it also fetches the number of records, but the records are not seen on the Report. Anybody knows why is this so??
Can anybody help me out?
I'm stuck up here!!!

the Following is the code written for it :

<%@ page errorPage="error.jsp" import="net.sf.jasperreports.engine.*,net.sf.jasperreports.engine.util.*,net.sf.jasperreports.engine.export.*,
java.util.Map,java.util.HashMap,java.sql.*,java.io.File,java.io.PrintWriter,oracle.jdbc.driver.OracleDriver"%>


<%
Connection conn = null;
String driver = "oracle.jdbc.driver.OracleDriver";
String hostName = "....";
String user = "abcde";
String password = "abcde";


File reportFile = new File(application.getRealPath("/reports/report.jasper"));

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());

Map parameters = new HashMap();
parameters.put("ReportTitle", "Address Report");
parameters.put("BaseDir", reportFile.getParentFile());


try{
Class.forName(driver);
conn = DriverManager.getConnection(hostName, user, password);

JasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport,parameters,conn);

/*JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport,
parameters,
dataSource);*/

JRHtmlExporter exporter = new JRHtmlExporter();

StringBuffer sbuffer = new StringBuffer();
Map imagesMap = new HashMap();
session.setAttribute("IMAGES_MAP", imagesMap);
System.out.println("before exporter ");
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
System.out.println("JASPER_PRINT ");
exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);
System.out.println("OUTPUT_WRITER ");
exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image.jsp?image=");
exporter.exportReport();
}catch(Exception e){
System.out.println(e.getMessage());
}

%>


Please do tell me where I'm wrong

thanks inadvance

Sherryl
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jasper Report blank