mp_we Posted September 18, 2007 Share Posted September 18, 2007 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 More sharing options...
fsaa Posted September 18, 2007 Share Posted September 18, 2007 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 More sharing options...
mp_we Posted September 19, 2007 Author Share Posted September 19, 2007 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 More sharing options...
fsaa Posted September 20, 2007 Share Posted September 20, 2007 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 More sharing options...
mp_we Posted September 21, 2007 Author Share Posted September 21, 2007 This is resolved. When setting the parameters to pass down to the subreport (A), the JRXmlDataSource parameter for AChild is set as JRXmlDataSourceObject.dataSource() Thanks for your reponses, fsaa. Link to comment Share on other sites More sharing options...
fsaa Posted September 22, 2007 Share Posted September 22, 2007 That's good.Regards.fsaa. Link to comment Share on other sites More sharing options...
samem_hr Posted October 4, 2007 Share Posted October 4, 2007 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 parameterachildDataSource and set it asJRXmlDataSourceObject.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 More sharing options...
fsaa Posted October 5, 2007 Share Posted October 5, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now