2006 IR Open Discussion Posted August 20, 2006 Share Posted August 20, 2006 By: Chris Hane - hane SubReport Filename as a Parameter 2003-10-08 10:49 Is it possibl to pass the name of a subreport file using a parameter? I'm trying the following (and a couple of different variations) without success. Or I should say, when I try to pass in the parameter I am getting an OutOfMemoryException. However, when I hard code the path, the report is generted correctly. Here is the snippet from the xml definition: parameter definition: <parameter name="DIRECTORY" isForPrompting="false" class="java.lang.String"/> subreport definition: <subreport isUsingCache="true"> <reportElement mode="Opaque" x="1" y="120" width="543" height="20" forecolor="#000000" backcolor="#FFFFFF" positionType="Float" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <dataSourceExpression><![CDATA[$F{items}]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{DIRECTORY}+"PackSlipItems.jasper"]]></subreportExpression> </subreport> Thanks, Chris.... By: Sunil - sunil_cet RE: SubReport Filename as a Parameter 2003-10-12 23:35 Yes. It is possible. You can pass the sub report filename to the main report as an ordinary parametre. From the main report, instead of passing the sub report file name as string you can pass this parametre 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