Jump to content
Changes to the Jaspersoft community edition download ×

Unable to locate the subreport with expression


CharleyDC5

Recommended Posts

Hi folks,

I just installed the new version of iReport (3.5.3) and tried the new automatic subreports compilation feature.

I always get the following message:

"Unable to locate the subreport with expression: "$P{BaseDir} + "mysubreport.jasper"".

Things I have tried :

1.   <subreportExpression class="java.lang.String"><![CDATA[$P{BaseDir} + "mysubreport.jasper"]]></subreportExpression>

2.   <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "mysubreport.jasper"]]></subreportExpression>

3.   <subreportExpression class="java.lang.String"><![CDATA["mysubreport.jasper"]]></subreportExpression>

Important notes :

  • My report and subreports are located in the same package/directory.

    For instance :

    Master report file : C:\eclipse\workspace\MYPROJECT\web\reports\myreport\test.jrxml
    Subreport file : C:\eclipse\workspace\MYPROJECT\web\reports\myreport\mysubreport.jrxml

  • BaseDir and SUBREPORT_DIR parameters are set to ""

Any idea?

Thank you very much for help

Charles

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Yes I understand that.

 

My iReport reports are bundled in a Java J2EE web application, so I can't use a physical path. Otherwise, my web app will search for the folder "C:\\honda\\hatc_boss_rep\\Real\\" (for example), which is not existing on my jboss production environment.

 

Every other report works like a charm. I'm just facing that problem with one report...

Link to comment
Share on other sites

so your file locations should then be in your classpath in which case just remove $P{BaseDir}

so the expression class should be string and value="mysubreport.jasper"

if you dont specify the location jasper will look in the same location as the parent report and if not found it will then search your class path.

Link to comment
Share on other sites

SOYHU,

This option is already checked in my ireport configuration :(

As I said, I have this problem with only one report. I understand why... I will try to create a new jrxml file and then copy the XML code into it.

 

JSquire,

You mean iReport classpath or application classpath?

 

Thanks for help!

Link to comment
Share on other sites

  • 11 months later...

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