Jump to content
Changes to the Jaspersoft community edition download ×

pass field values to subreport


Recommended Posts



I'm really new for Jasperreport now.

I'm having a troble at passing field value from main report to sub report..


the following is my main report code;

                <reportElement x="140" y="180" width="530" height="303" uuid="d23de6fe-970c-49e1-b747-0b1cdd2a7e86"/>
                <subreportParameter name="PIE_NM">
                <subreportParameter name="RATIO">
                <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>


the following is my sub report code;

    <field name="PIE_NM" class="java.lang.String"/>
    <field name="RATIO" class="java.math.BigDecimal"/>





the followings are the field values 


95        Automatics
4         Manual
1         FAIL


what is expected to see from subreport was 95(Automatics)/4(Manual)/1(FAIL) ratio pie chart,

but what I actually got was 100(Automatics)


I guess this is becuase the parameter cannot send Array or List Object...

so it carried only one value - Automatics


is that correct?

if so, how can I pass field list value to subreport as a parameter?


Thanks in advance.

and sorry for my bad English.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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