2001 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: JC Tchitchiama - jeanch NPE when added a second subreport 2002-10-01 02:50Hi, I am a jasper newbie so please be kind to me if my question is trivial or indeed has already been answered. First of all congratulations for Jasper tool I think it's great and one can get a report together in no time at all. Here is my query: I have just appended a subreport to the MasterReport example and that works fine. Now I am adding a second report containing a picture and I get the following NPE [java] java.lang.NullPointerException [java] at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:338) [java] at dori.jasper.engine.fill.JRFillSubreport.run(JRFillSubreport.java:369) [java] at java.lang.Thread.run(Thread.java:484) Here is how the subreport is defined in the Master.xml <subreport isUsingCache="true"> <reportElement x="5" y="25" width="500" height="20" backcolor="#FFFFDD"/> <subreportParameter name="City"> <subreportParameterExpression> $F{City} </subreportParameterExpression> </subreportParameter> <connectionExpression> $P{REPORT_CONNECTION} </connectionExpression> <subreportExpression class="dori.jasper.engine.JasperReport"> "NewReport.jasper" </subreportExpression> </subreport> Cheers JC By: Teodor Danciu - teodord RE: NPE when added a second subreport 2002-10-01 02:56 Hi, The "class" attribute of your <subreportExpression> element should not be "dori.jasper.engine.JasperReport", because you are not supplying an in-memory report object, but rather try to load it from disk. This attribute should be "java.lang.String", I suppose. Read the "Quick Reference". I hope this helps. Teodor By: JC Tchitchiama - jeanch RE: NPE when added a second subreport 2002-10-01 08:20Got it !! when adding a subreport one must supply either a connectionExpression or a DataSource. Note that an empty data source is OK too when you don't have a data source per say. Cheers JC 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