developer Posted May 2, 2008 Share Posted May 2, 2008 Hi All, I am new in JasperReports and I need to generate reports from Servlets/JSP. In Console Application I use code: Code:try { JasperReport jasperReport = JasperCompileManager.compileReport(getServletConfig().getServletContext().getRealPath("/reports/test.jrxml"«»)); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource()); JasperExportManager.exportReportToPdfFile(jasperPrint, getServletConfig().getServletContext().getRealPath("/reports/my.pdf"«»)); } catch (JRException e) { e.printStackTrace(); } But when I copy this code to servlet the following exception shown: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209745155775_886062.java:4: package net.sf.jasperreports.engine does not existimport net.sf.jasperreports.engine.*;^D:Program Filesnetbeans-5.5enterprise3apache-tomcat-5.5.17binsimple_1209745155775_886062.java:5: package net.sf.jasperreports.engine.fill does not existimport net.sf.jasperreports.engine.fill.*; What setting I must do for working properly?I see examples from DEMO and tried to run in but there are the same problems:( Can somebody help me: I use NetBeans 5.5 , Apache Tomcat 5.5.17May be trouble is in wring setting??? Can somebody show me the simple example how to generate report from Servlet Step by Step THANKS VERY MUCH THAT YOU READ THIS MESSAGE AND MAY BE HELP ME Link to comment Share on other sites More sharing options...
lucianc Posted May 3, 2008 Share Posted May 3, 2008 Read this FAQ on report compilation. HTH,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now