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

subreports showing headers but no details


2005 IR Help

Recommended Posts

By: kbssudo - kbssudo

subreports showing headers but no details

2004-05-16 08:54

Hi all,

 

I have 1 master report containing 2 subreports. Both subreports display a TableModel content (using JRTableModelDataSource). When previewed (JasperViewer) individually, both subs display correctly. But when previewing the master report, I get as many report pages as table rows, all of them displaying the table headers but not its contents.

I'm filling each subreport first and then passing them to the master report as parameters.

 

Why it happens?

 

 

 

 

By: C-Box - c-box

RE: subreports showing headers but no details

2004-05-17 01:06

Don't try to fill both SubReports before filling the MasterReport.

 

Try this:

 

1.) Load SubReport1 from XML/InputStream

2.) Compile SubReport1 to JasperReport-Object

3.) Load SubReport2 from XML/InputStream

4.) Compile SubReport2 to JasperReport-Object

5.) Create Datasource(s) for the SubReports and create JRDataSource-Object(s) for it

6.) Put both compiled JasperReport-Objects into a master-parameter-map

7.) Put the DataSource(s) also in the master-parameter-map

8.) load the MasterReport from XML/InputStream

9.) Compile the MasterReport to JasperReport-Object

10.) Fill the MasterReport with Master-JasperReport-Object, master-parameter-map and DataBaseConnection (or MasterDataSource).

 

... and voilá©t should work!

 

hth

C-Box

 

 

 

 

 

By: kbssudo - kbssudo

RE: subreports showing headers but no details

2004-05-17 06:34

Thanks c-box, it did work as expected.

I had another problem though. Please check the post 'Subreports overlapping'

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