Jump to content

Recommended Posts

By: Ruben Misrahi - rnmisrahi

Subreports

2003-08-26 14:36

I need to define the place of a subreport at runtime.

I'm using DataSource and I have:

<subreport isUsingCache="true">

<reportElement mode="Opaque" x="7" y="21" width="521" height="24" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false" />

<dataSourceExpression>$F{SubReport}</dataSourceExpression>

<subreportExpression class="java.lang.String">

<![CDATA[ new String("c:\Celerant\AsReports\SvcCust.jasper")

]]>

</subreportExpression>

</subreport>

 

Is there a way to define the subreport expression at runtime?

The reason is: I don't know in which directory will the .jasper subreport is going to be.

 

 

Thanks for any help

 

Ruben Misrahi

 

 

 

 

By: Jeff Erlandsson - theace

RE: Subreports

2003-08-27 06:41

Sure, you can put the path to the subreport file in a parameter. Define a parameter (for example $P{SUBREPORTPATH}) in the xml-file. Use that parameter in the subreportExpression.

Look at the samples if you don't know how to pass parameters to the filling method.

 

- Jeff

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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