Jump to content
We've recently updated our Privacy Statement, available here ×

Jasper in WebApplication


developer

Recommended Posts

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 exist

import 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 exist

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

May 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

  • Replies 1
  • 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...