mbannout_1 Posted March 9, 2017 Share Posted March 9, 2017 Hello guys, i'm not an expert in jasper reports but i need to make a complex report. i am using Jasperserver community edition and ireport 5.6.i need to run 2 queries:query 1 on datasource 1, result will be 4 fields as follows: MID, Last order, Total Sales, Total purchases.query 2 on datasource 2, result will be 5 fields as follows: MID, Shop Code, Region, Branch, SM ID.what i need the report to do is display the results in one table like this: MID, Shop Code, Region, Branch, SM ID, Last order, Total Sales, Total purchases.then i need to show a little summary table that shows different counters example: number of entries with total sales below $500 per region etc.what is the best and simplest way to go about ? any help is appreciated. Link to comment Share on other sites More sharing options...
darth_fader Posted March 10, 2017 Share Posted March 10, 2017 Don't know of a decent way to use multiple data sources in the same report unit without a subreport for each distinct datasoure, but if you put that in place and return values from the subreports, then combine those in your main report you'll get what you need accomplished. See my approach here: http://community.jaspersoft.com/questions/540250/clarification-multiple-datasources-report Link to comment Share on other sites More sharing options...
mbannout_1 Posted March 11, 2017 Author Share Posted March 11, 2017 Thanks for the reply "gertbeedfrobe"I have tried what you suggested and it works to some extent. the subreport is supposed to take one input from main report called MID for each record and return 4 variables. the problem is that for each page only the first record is correct, the remaining records are repeats for the first one.please see below the results i am getting:MID Last Order Purchases Sales Shop Code Region Branch SMID10025 06-Mar-17 500 730 DDCAT01133 Central Riyadh 110110110061 06-Mar-17 1300 1170 DDCAT01133 Central Riyadh 110110110070 02-Mar-17 1100 1070 DDCAT01133 Central Riyadh 110110110075 08-Mar-17 500 730 DDCAT01133 Central Riyadh 1101101 first 4 columns are from the main report, second 4 columns are returned values from the subreport. as you can see, the returned values are repeating and only update on the second page.what could be wrong ? Link to comment Share on other sites More sharing options...
mbannout_1 Posted March 11, 2017 Author Share Posted March 11, 2017 I did not find the problem in my previous approach but i have found a work around thanks to your help. i am passing all 4 parameters from the main report to the subreport then displaying all the data at the subreport level. 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