Jump to content
Changes to the Jaspersoft community edition download ×

Subreport within subreport


raphy

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Example of main report bean

Code:

private String ID;
private String name;
private JRDataSource subDS_1;
private JRDataSource subDS_2;

 

Example of sub report 1 bean

Code:
[code]
private String ID;
private String work;
...
...

 

Example of sub report 2 bean

Code:
[code]
private String ID;
private String workDetail;
...
...

 

OK, for example:

We got 1 record for main report,

5 records for sub report_1,

3 records for sub report_2...

If we put sub report bean 2 under sub report bean 1,

than we will have 5 x 3 = 15 sub report 2 beans in memory, it's terrible...

 

So, we can put all sub report bean under main report bean.

 

The following code are expressions for design time in iReport:

 

Include sub report 1 from main report

DataSoure:

Code:
[code]$F{subDS1}

Parameter

Code:
[code]
$P{subReport_DIR} (String)
$F{subDS2} (JRDataSource)

 

Include sub report 2 from sub report 1

DataSource:

Code:
[code]
$P{subDS2}

 

 

Than we can pass DataSource from main report to last sub report via report parameter.

 

Hope it helps~

 

--

We are coming from TAIWAN...~_~

Post edited by: RoseRoo, at: 2006/11/02 07:16

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