neon Posted May 15, 2008 Share Posted May 15, 2008 Hi! I have one master report in which I have sql query which return about 100 000 rows. For every row I must get one field(column) and put that field to subreport which then use that field for call procedure and write one row in table in subreport. I need sugestion how to put 100 000 fileds to subreport, most elegant option and most effective solution. Thx. in advance! Link to comment Share on other sites More sharing options...
systemp Posted May 16, 2008 Share Posted May 16, 2008 Hi, Wish I can help,I kind of have a problem close to yours.I have four subreports on my master report,anytime I run it I see only one and the rest either covering up each other i try correcting the dimensions but yet still did not work as I was experting it. Any Idea will be welcomed.ThanX Link to comment Share on other sites More sharing options...
lshannon Posted May 16, 2008 Share Posted May 16, 2008 Here is one idea. I am not sure it is more elegant or effective, but maybe it will further the discussion and get some other ideas coming in. You could prepare the entire resultset the subreport would consume outside of the report. You would create a helper class that would make the DB calls. This helper would be called from the main report and could be passed in the $P{REPORT_CONNECTION} to be used as a JDBC Connection. In the helper you could make all the calls to the procedure for each field. The issue now is how to get all these resultsets into one thing the subreport could consume. One idea is the helper class could maintain a collection of maps. For each call to the procedure you make you could convert the resultset to a map (http://commons.apache.org/dbutils/apidocs/org/apache/commons/dbutils/BasicRowProcessor.html).Each map would be added to the collection. The the subreport could have a data expression like this: new JRMapCollectionDataSource(ReportHelper.getCollectionOfDataMaps()) Like I said, just an idea for now. Lets see if anyone else can come up with another approach.Post edited by: lshannon, at: 2008/05/16 14:55 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