Re: Re: Somewhere a short howto for using JasperReports with WO?
Re: Re: Somewhere a short howto for using JasperReports with WO?
- Subject: Re: Re: Somewhere a short howto for using JasperReports with WO?
- From: "RedBugz Software" <email@hidden>
- Date: Sun, 12 Nov 2006 10:21:50 -0700
Everything wents fine until you hit the print button. At this point a
null pointer exception occured:
[2006-11-09 10:10:36 CET] <WorkerThread0> java.lang.NullPointerException
at com.wocode.jasper.WCJRUtils.compileReport(WCJRUtils.java:40)
at com.wocode.jasper.WCJRUtils.printReport(WCJRUtils.java:86)
at Main.printReport(Main.java:45)
at Main.printReport(Main.java:67)
...<snip>
I´ve filled the database with some movies, actors... so there is data
which can be printed. Any ideas what might happen?
Sorry it took so long to get back on this.
The problem is that it can't find your report file.
Here's the code:
URL reportURL =
app.resourceManager().pathURLForResourceNamed(reportName,
frameworkName, null);
return JasperCompileManager.compileReport(reportURL.getPath());
reportURL is null, because the call to
app.resourceManager().pathURLForResourceNamed() is failing.
This was triggered by this code:
public static boolean printReport(String reportName, String
frameworkName, Map parameters, JRDataSource datasource,
String printerName) throws JRException, URISyntaxException
{
JasperPrint jasperPrint = null;
if(reportName.endsWith("xml"))
{
JasperReport report = compileReport(reportName, frameworkName);
so the reportName and frameworkName are not resulting in a file that
WebObjects can find. You may want to try some logging with
app.resourceManager().pathURLForResourceNamed(reportName, frameworkName, null);
for various of values of reportName and frameworkName (use null for
the frameworkName if it's in the application itself) to see where the
problem is.
HTH,
Logan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden