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

nested subreport


mp_we

Recommended Posts

Hello,

 

I have a Master report that has a subreport 'A'. Subreport 'A' has a subreport 'AChild'.

i would like to pass a XMLDatasource parameter for AChild from the Master report.

I am using iReport 2.0 to create these reports.

 

I created a JRXmlDataSource parameter in Master and used that as 'Subreport Parameter' for subreport 'A'. In the subreport 'A', I specified 2 parameters - one for the AChild subreport and another for AChild XMLDataSource.

 

1. How to I specify the XMLDataSource parameter as an 'input' parameter in subreport 'AChild'?

 

Thank you.

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

There are some ways of doing what you want. I will suggest one of them:

 

1. In the master report: create a parameter, say achildDataSource, in the master report.

 

2. In A report: you must acess properties of the Achild subreport and specify in the field "Connection/Data Source expression" in the folder "Subreport", the following:

- Select "use datasource expression"

- Fill in the value as $P{achildDataSource}

 

good luck!

fsaa.

Link to comment
Share on other sites

Thanks for your response. Here is what I have:

1. In the Master report I have created 2 parameters - One for nested subreport(JasperReport object) and one for the subreport datasource (JRXmlDataSource object)

2. In the Master report, subreport element, I have included the 2 parameters as "Subreport Parameters"

3. In the 'A' report, I have 2 parameters (same names as Master) that I am using to populate the nested subreport 'AChild'

 

But looks like I am missing something because the nested subreport AChild doesn't display.

 

Could someone provide with some pointers.

 

Thanks.

Link to comment
Share on other sites

Hi!

 

As you didn't mention about the datasource of achild report, it seems as if there is not any definition regarding this item.

 

As I said in the last post, you must specify the datasource of Achild from the A report file, and more specifically, under subreport item properties window.

 

You can pass a parameter as datasource (look my last post) or you can specify a constructor with a field as argument.

 

That's it. I hope it runs.

 

fsaa.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I tried whatever was written in this thread, am trying to achieve a similar output, but am unsuccessful.

 

I dont understand how to create the datasource parameter

achildDataSource and set it as

JRXmlDataSourceObject.dataSource()

 

where are we supposed to do this?

 

I just created the parameter and set the type as emptydatasource and passed the same to the child report, but still am not able to see the nested child report

 

Please explain to me clearly the steps...thanks in advance.

I wud greatly appreciate it.

Link to comment
Share on other sites

Hi,

 

I could not understand well what is the problem you're dealing. How many reports do you have and how do you want to pass the datasource for your reports: by parameter or by a connection?

 

If you detail better the situation, I can try to help you.

 

fsaa.

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