Jump to content

More Tables (one below the other) in -one- Report


Congor

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I solved the problem.

 

First i made a master-report (like in the example which is called "subreport of the project) then i made a Subreport and a SubSubreport

 

in the masterReport i used the column header and

detail for the first table. And inserted the

subreport into the summary band!

 

(Cause i made tests with the overflow behaviour of

all the bands, with the result that just detail and

summary support overflow in proper way, the other

bands not!)

 

The second Table i added to the columnHeader and

detail band of the Subreport.

I added the SubSubreport into the summary

band of this Subreport as i did before with the

masterReport.

 

And the third table into the SubSubreport,

again in column header and detail band.

 

All of these reports use the Report_Connection of

the master report therefore, i had to define parameters for all DataSources and Sub- and

SubSubreports in the Masterreport (execpt its own

datasource, cause it is automatically handed over as

the REPORT_DATASOURCE Parameter when calling

fillToReport(..,masterReportDataSource) in Java).

 

 

I ended up havin following -Parameters- in the

masterReport:

 

Subreport (of class JasperReport)

SubSubreport (of class JasperReport)

SubreportDataSource (of class JRDataSource)

SubSubreportDataSource (of class JRDataSource)

 

and in the Subreport:

 

SubSubreport (of class JasperReport)

SubSubreportDataSource (of class JRDataSource)

 

 

Then i configurated (in the master report)the subreport properties as follows:

 

1. it uses the SubReportDataSource (defined before as

parameter) as its datasource.

 

2. it is the Subreport that will be handed over as

the subreport parameter(in "subreport expression")

of class net.sf.jasperreports.engine.JasperReport.

 

3. it TAKES the SubSubreportDataSource and the

SubSubreport (both defined as parameter) as Parameters. (in "subreport parameters").

 

Then i configurated the SubSubreport in the -summary

band of the subreport- just as before for the

subreport in the masterreport except that i now

used the SubSubreport and the SubSubreportDataSource.

 

Of course, in Java we have to hand over all DataSources and sub(sub)reports in the parameters map

of the master report just as normal parameters.

 

 

parameters.put("Subreport", mySubreport);

parameters.put("SubreportDataSource", mySubreportDataSource);

 

parameters.put("SubSubreport", mySubSubreport);

parameters.put("SubSubreportDataSource", mySubSubreportDataSource);

 

 

 

Where:

mySubreport.class == JasperReport

mySubreportDataSource.class == JRDataSource

"Subreport", "SubreportDataSource" are the names

of the -Parameters- in the masterReport as i said

before.

 

Hope anyone can use this.

 

Yves

Post edited by: Congor, at: 2007/01/25 09:03

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