Jump to content

Subreport within subreport


johnbor

Recommended Posts

Hi,

 I would like to use subreport inside another subreport. So the idea is that:

 Master report -> Subreport1 -> Subreport2.

  And i would like to see that in the end:

- PC Store1

--- Address: USA, Baltimore

--- Telephone number: xxxxx

--- Softvers: ( Subreport1 )

-----Description: Good stuff

-----Details: Very good stuff

-----Caution: Not very good stuff

-----Types: ( Subreport2 )

-------OS: Windows

-------Game: COD,WOW, etc.

- PC Store2

--- Address: ITA, Rome

--- Telephone number: xxxxxx

--- Softvers: ( Subreport1 )

-----Description: xxxx

-----Details:xxxx

-----Notion:xxxxx

-----Types: ( Subreport2 )

-------OS: Linux

The problem is that I don't find the appropriate data modell in Java. I tried to use the JRBeanCollectionDataSource way and the store and type data is ok, but i can't give the right data for subreport2.

Can anyone has experience in this area of Jasperreports ( 3.6.1 )??

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

There's nothing special about the second level of subreports.  So if you have a data model for the first subreport level, that's exactly what you need to have at the second level.

And what you need to have are list/collection fields at each leve, which you use as data source for the subreports by wrapping them in JRBeanCollectionDataSources.

Regards,

Lucian

Link to comment
Share on other sites

  • 1 year later...

Can this method that you suggested be applied if it dataSource is og type JRResultSetDataSource.

I tried passing JRResultSetDataSource as a parameter to subreports , but when I ran it says resultSet is closed.

Can you please help me on this .

Thanks,

ckgupta

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