2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: ryanwu - ryanwu How do I set the relative path to subreport 2003-03-18 00:42 how can I set the relative path to subreport in my main report by iReport.. ex: <subreportExpression class="java.lang.String"><![CDATA[ "Report2_1.jasper" ]]></subreportExpression> ?? like above setting doesn't work By: MMMMMM - mazzam RE: How do I set the relative path to subrepo 2003-03-24 01:31 I'm having the same problem, I want to run a report from a servlet, I'm able to specify the location of the master report, but I have to put the subreports in the classes dir. How can I specify the location of the subreport??? TIA Mauro By: Davin Desborough - ddesborough RE: How do I set the relative path to subreport 2003-03-25 13:01 I am using subreports in BEA/JSP and I simply pass the path of the sub report as a parameter when calling Jasper. Jsp: Map parameters = new HashMap(); parameters.put("ReportTitle", reportTitle); parameters.put("Sort", sort); parameters.put("subReport", "myPath/resoucesSub.jasper"); Java (jsp sets paramets before calling gen eration method): JasperRunManager.runReportToPdfFile(fileName, outputFile, parameters, getConnection()); Jasper XML: <parameter name="subReport" isForPrompting="true" class="java.lang.String"/> ... <subreportExpression class="java.lang.String">$P{subReport}</subreportExpression> -Davin By: Teodor Danciu - teodord RE: How do I set the relative path to subreport 2003-03-25 14:05 Hi, With the about setting, you have to have the Report2_1.jasper file in the current directory (which I don't think is the case especially if you are in Web environment) or have it in the classpath. If you add the directory that contains this .jasper file you your classpath, then the engine should see it. In web environment, the best way to do it is to place the .jasper files under the WEB-INF/classes directory as it is always part of the classpath of you web application. If you have, let's say, your subreport at this location: WEB-INF/classes/reports/Report2_1.jasper then in the master report, it should be referenced like this: <subreportExpression class="java.lang.String"> <![CDATA[ "reports/Report2_1.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