2002 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: Adriana Mestrinelli Paranhos - jasperdri not loading sub-reports... 2003-03-05 12:42 Hello everyone.. I have a report with sub-report....when I run it with iReport, everything goes OK..... but when I try to run it within my app, occurs an error saying that it can´t find the .jasper file from my sub-report...but this file is in the same directory from my app.... how can i solve this problem?? thanx By: juan david vergara perez - jvergara RE: not loading sub-reports... 2003-03-05 13:39 i solved the same problem, given the full path of the jasper template for the sub report. for example( unix) /home/projects/myApp/jasper/template.jasper By: Teodor Danciu - teodord RE: not loading sub-reports... 2003-03-25 13:35 Hi, When you supply the name of the master report, you probably use a relative path or an absolute one. But in the <subreportExpression> you have to use the same location, because the engine does not search relative to the master report directory. This is not a very good approach. The best way is to put the directory containing the report templates into the classpath. If you put the .jasper files in a structure like this: classes/com/mycompany/reports/Master.jasper classes/com/mycompany/reports/Subreport.jasper You the add the "classes" directory to the classpath and the subreport expression could be: <subreportExpression class="java.lang.String"> "com/mycompany/reports/Subreport.jasper" </subreportExpression> I hope this helps. Teodor 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