nagaraju Posted August 20, 2010 Share Posted August 20, 2010 Hi,I would like to fill a .jasper fill with multiple JRBeanCollectionDataSource before exporting it into pdf. Report should have table and multiple charts. Each chart is from different Collection object. I managed to fill a report from one JRBeanCollectionDataSource. I am not able to fill multiple JRBeanCollectionDataSource into single .japser.Can anybody please help regarding this?Thanks in advance.Regards,Nagaraju Bandaru Link to comment Share on other sites More sharing options...
kingananth007 Posted September 27, 2010 Share Posted September 27, 2010 Ideally a report can have single datasource - say Create an Object that has all the object arrays (your collection Objects) that you require for the report and pass this single object as bean data source and fill your report. one more solution - Print all your bean collection DS separately and later stich it. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted September 28, 2010 Share Posted September 28, 2010 Hi, It depends on how you want the looping through your list of JRBeanCollectionDataSource instances to be performed.You could make a FOR loop yourself in your application and produce multiple JasperPrint objects that then you export to the target format using what we call batch export. Just provide the list of JasperPrint objects to the exporter as the JASPER_PRINT_LIST parameter. A different approach would be to wrap your list of JRBeanCollectionDataSource instances into yet another JRBeanCollectionDataSource.With this master data source you fill a master report which in its detail band contains the normal report as subreport.You then make sure that in your master report, you declare a field called _THIS, to point to the current bean data source coming from the master's data source and pass that to the subreport as <dataSourceExpression>. I hope this helps.Teodor 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