raphy Posted October 25, 2006 Share Posted October 25, 2006 Hello,Is it possible to use a subreport containning another subreport. If yes how can I pass a custom datasource to the last subreport.Thanks for your help.Raphy Link to comment Share on other sites More sharing options...
RoseRoo Posted October 25, 2006 Share Posted October 25, 2006 It's possible~ You can pass your data source via report parameter.Just remember to set parameter type to JRDataSource not JREmptyDataSource --We are coming from TAIWAN ~_~ Link to comment Share on other sites More sharing options...
raphy Posted October 25, 2006 Author Share Posted October 25, 2006 Hello, Thanks for your reply, have you any exemples for this problem (i.e: i am using a masterreport containinng a subreport containg itself another subreport):Raphy Link to comment Share on other sites More sharing options...
oauh Posted November 1, 2006 Share Posted November 1, 2006 Hi, I would appreciate an example too. Thanks a lot. oauh@seznam.cz Link to comment Share on other sites More sharing options...
RoseRoo Posted November 2, 2006 Share Posted November 2, 2006 Example of main report beanCode:private String ID;private String name;private JRDataSource subDS_1;private JRDataSource subDS_2; Example of sub report 1 beanCode:[code]private String ID;private String work;...... Example of sub report 2 beanCode:[code]private String ID;private String workDetail;...... OK, for example:We got 1 record for main report,5 records for sub report_1,3 records for sub report_2...If we put sub report bean 2 under sub report bean 1,than we will have 5 x 3 = 15 sub report 2 beans in memory, it's terrible... So, we can put all sub report bean under main report bean. The following code are expressions for design time in iReport: Include sub report 1 from main reportDataSoure:Code:[code]$F{subDS1}ParameterCode:[code]$P{subReport_DIR} (String)$F{subDS2} (JRDataSource) Include sub report 2 from sub report 1DataSource:Code:[code]$P{subDS2} Than we can pass DataSource from main report to last sub report via report parameter. Hope it helps~ --We are coming from TAIWAN...~_~Post edited by: RoseRoo, at: 2006/11/02 07:16 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