Jump to content
We've recently updated our Privacy Statement, available here ×

Using filled report as subreport


stinus

Recommended Posts

is it possible to use a filled report as subreport ?

According the manual the subreportexpression has to be of the type :

java.lang.String
java.io.File
java.net.URL
java.io.InputStream
net.sf.jasperreports.engine.JasperReport

A JasperReport file isn't filled yet, so only the java.io.InputStream is left, but how to create the inputstream, from whitch file type do I have to start ? JasperPrint ?

On my main report :

<subreportExpression class="java.io.InputStream"><![CDATA[$P{SubReport}]]></subreportExpression>

and as parameter I pass the java.io.InputStream...

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi stinus,

In one of my reports where I use subreports, it is defined as follows:

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

And the "SUBREPORT_DIR" is defined in the beginning of the file as follows:

    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["..//jrx//"]]></defaultValueExpression>
    </parameter>

HTH,

Regards

Link to comment
Share on other sites

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