having problems to generate pdf in struts app

By: Honghai Zhang - haroldzhang
having problems to generate pdf in struts app
2003-12-09 09:55

I want to use jasper reports to generate pdf in a struts action class.
Here is the code segment
try {
JasperCompileManager.compileReportToFile(fileName + ".xml");
Map parameters = new HashMap();
JasperRunManager.runReportToPdfFile(fileName + ".jasper", parameters, new JREmptyDataSource());
_log.debug("fileName: " + fileName + ".xml");
catch (JRException e) {

try {
// hard coded for demo
InputStream content = new FileInputStream(fileName + ".pdf");

// XXX Need to buffer this a little.
int b;
while( (b = content.read()) != -1 ) {
outputStream.write( b );

} catch( java.io.IOException e ) {
_log.error( "error", e );

I got the following error message when I try to generate a pdf file use this struts app after I deployed it in weblogic server 6.1. Note: Although I can use jasper reports to do the same when I run it as an stand alone java app.

dori.jasper.engine.JRException: Errors were encountered when compiling report expressions class file:
/export/home/weblogic/config/hzhang/SalesOrder.java:4: package dori.jasper.engine does not exist
import dori.jasper.engine.*;
/export/home/weblogic/config/hzhang/SalesOrder.java:5: package dori.jasper.engine.fill does not exist
import dori.jasper.engine.fill.*;
/export/home/weblogic/config/hzhang/SalesOrder.java:17: cannot resolve symbol
symbol : class JRCalculator
location: class SalesOrder
public class SalesOrder extends JRCalculator
/export/home/weblogic/config/hzhang/SalesOrder.java:24: cannot resolve symbol
symbol : class JRFillParameter
location: class SalesOrder
private JRFillParameter parameter_REPORT_CONNECTION = null;
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 7 months ago

0 Answers:

No answers yet