henstockjohn Posted January 6, 2010 Share Posted January 6, 2010 I am evaluating reporting tools and have been looking at JR. The test report I have developed has the requirement for the following format of report: -----------------------------------------------------------------------------------------------------------------------------Customer Group: ABC Customer Account: TEST123-----------------------------------------------------------------------------------------------------------------------------Balance Info 1 USD : <Balance Value 1> <Balance Value 2>...Balance Info 1 GBP: <Balance Value 1> <Balance Value 2>...-----------------------------------------------------------------------------------------------------------------------------Balance Info 1 TOT: <Sum(Value 1 *FXrate)> <Sum(Value 2 * FXrate)>....----------------------------------------------------------------------------------------------------------------------------Balance Info 2 USD: <Balance Value 21> <Balance Value 22>...Balance Info 2 GBP: <Balance Value 21> <Balance Value 22>...----------------------------------------------------------------------------------------------------------------------------Balance Info 2 TOT: <Sum(Value 21 * FXrate)> <Sum(Value 22 * Fxrate)>..And so on.We designed this in iReport with a main report and a series of subreports. The main query returns all the records required for Group ABC and loops through the resultset producing the Balance Info 1 section breaking on Customer Account. A parameter is then used to pass the Customer Account = "TEST123" and subreport queries again this time for "TEST123". We are dealing with large amounts of data and the main query is fairly efficient but the subreport queries with a query per account cause slow performance.We have tried both a JDBC connection and a custom dataset passing a resultset but what would be the recommended approach to effeciently producing this type of report? Can we pass rows from the main report to the subreport to remove the requirement for multiple queries - they are in fact all the same records in section 1 and 2.ThanksJohn Link to comment Share on other sites More sharing options...
henstockjohn Posted January 6, 2010 Author Share Posted January 6, 2010 Can anyone help with this?Thanks Link to comment Share on other sites More sharing options...
henstockjohn Posted January 7, 2010 Author Share Posted January 7, 2010 Anyone? Link to comment Share on other sites More sharing options...
lucianc Posted January 7, 2010 Share Posted January 7, 2010 What you want has been requested at http://jasperforge.org/projects/jasperreports/tracker/view.php?id=2695. There's no solution built into JR for it.There are ways to do it, but not very pretty. If the data for the subreports is small, you can have a scriptlet that collects the records in memory and passes a JRMapCollectionDataSource to the subreports. You would have a group for customer and place the subreports in the group footer.Regards,Lucian Link to comment Share on other sites More sharing options...
henstockjohn Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks for the response. I was actually going to try a solution along the same lines outlined here:http://knol.google.com/k/jasper-reports-working-with-beans-and-sub-report#An_Example_of_Using_An_ArrayList_As_A_Data_Source_For_JasperReportsDo you think this would work? Link to comment Share on other sites More sharing options...
lucianc Posted January 8, 2010 Share Posted January 8, 2010 Yes, that should work.Regards,Lucian 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