2005 IR Help Posted September 3, 2006 Posted September 3, 2006 By: cbaeza - cbaeza Master Report: 2 SubReport, 2 DataSource 2005-12-15 12:23 Hi, I try do make a Master Report with 2 SubReport and each SubReport is composed by 2 different XML DataSource: iReport can use many SubReport (and subsubreport), but the same one Connection DataSource (XML for my Example). With a unique XML DataSource iReport it works very well, but: - How I can pass to each SubReport different XML DataSource ??? Master_Report ---- SubReport_1 (XML DataSource_1) | ---- SubReport_2 (XML DataSource_2) Thanks in Advanced, Carlos [email protected] By: Chris Germano - netslayer RE: Master Report: 2 SubReport, 2 DataSource 2005-12-15 15:29 i've never done this before. i'd check the Connection / Database Expression stuff under the Subreport properties. By: C-Box - c-box RE: Master Report: 2 SubReport, 2 DataSource 2005-12-16 02:11 Just pass your two datasources from outside to the masterreport and use them as Parameter within each subreports datasource-expression: $P{SubDatasource1} $P{SubDatasource2} quite easy... I have up to 9 different datasources linked to several subreports... works great. hth C-Box By: cbaeza - cbaeza RE: Master Report: 2 SubReport, 2 DataSource 2005-12-16 05:40 Thank C-Box, You can explain with more details the definition of the parameter. $P{SubDatasource1} - Parameter class Type - default Value Expression - Parameter Description Also, my XML DataSource is as: XML DataSource: =============== Name: MyXML_Data_Source XML File: ./file.xml Select Expression: /document Thank an advanced :) Carlos By: C-Box - c-box RE: Master Report: 2 SubReport, 2 DataSource 2005-12-16 10:18 Well, I don't have any experiences with XML-DataSources (as I remember right, this kind of datasource is very slow when there are much data inside) ... but as the principle is the same... my parameters are of class "JRDataSource" (ok I implemented my own one... but this extends the JRDataSource) DefaultValue and Description is not needed. So just create your datasources either BEFORE and pass it as Parameter as I described or perhaps you can also use an expression like "new JRXmlDataSource("XmlFile","YourNodeForSubReport1")" ... note: I DON'T KNOW ANYTHING ABOUT THE XML-DATASOURCE - just abstract it as you would do it for a single report) hth C-Box
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