[jasperreports-questions] How about loop a sub report?

2009-06-03 Thread Peter Jin
Hi, I may need to put several sub reports in the detail section in the master report. So the sub reports will get loaded many times. Will this cause significant performance issues? Does jasper cache data source for report in this case? My case: User's data are scattered in 5 tables and I need to

[jasperreports-questions] How about loop a sub report?

2009-06-16 Thread Peter Jin
Hi, I may need to put several sub reports in the detail section in the master report. So the sub reports will get loaded many times. Will this cause significant performance issues? Does jasper cache data source for report in this case? My case: User's data are scattered in 5 tables and I need to

Re: [jasperreports-questions] How about loop a sub report?

2009-06-03 Thread chr15athome
Hi Peter, If I understand your requirements correctly I think grouping would be better than having multiple subreports. Grouping the data on users allows you to create a seperate table for each user, you can also have a header and footer for each user and you can also perform calculations and ha

Re: [jasperreports-questions] How about loop a sub report?

2009-06-03 Thread chr15athome
Sorry I forgot to mention that the info I gave is based on using iReport/jasperReports, not sure what you are using now but I definately recommend iReport. Chris chr15athome wrote: > > Hi Peter, > > If I understand your requirements correctly I think grouping would be > better than having mul

Re: [jasperreports-questions] How about loop a sub report?

2009-06-03 Thread Peter Jin
Hi Chris, Thanks for your reply. Grouping can not solve my issue because it works on one data source only. In my case, data for a user scattered in 5 tables. UNION might be a way to combine all tables to a data source, but I can not use it either (explained in the first post). any thoughts? -- V

Re: [jasperreports-questions] How about loop a sub report?

2009-06-03 Thread chr15athome
Its hard to give advice when I have no real idea of your data structure, I am unsure why you would have seperate tables for differents users unless you mean graphically. If you have 5 separate tables 1 for each user then UNION seems to be the only way to do it, unless you know Java, you could put

Re: [jasperreports-questions] How about loop a sub report?

2009-06-03 Thread David Bolen
Peter Jin writes: > Grouping can not solve my issue because it works on one data source only. In > my case, data for a user scattered in 5 tables. UNION might be a way to > combine all tables to a data source, but I can not use it either (explained > in the first post). any thoughts? It's still

Re: [jasperreports-questions] How about loop a sub report?

2009-06-04 Thread Peter Jin
We have an audit system which uses separate tables with similar structure to store different kinds of activities for a user. We want to report the number of activities per activity type per user. David Bolen-2 wrote: > > Peter Jin writes: > >> Grouping can not solve my issue because it works

Re: [jasperreports-questions] How about loop a sub report?

2009-06-04 Thread Peter Jin
Thanks a lot for your comments. We have an audit system which uses separate tables with similar structure to store different kinds of activities for a user. We want to report the number of activities per activity type per user. I'll consider to create a view first. chr15athome wrote: > > Its ha

Re: [jasperreports-questions] How about loop a sub report?

2009-06-04 Thread chr15athome
Yes I overlooked using JOIN. Used to use JOIN for multiple tables in my old system. If you are not up on Joins I have an example I can send. David Bolen-2 wrote: > > Peter Jin writes: > >> Grouping can not solve my issue because it works on one data source only. >> In >> my case, data for a u

Re: [jasperreports-questions] How about loop a sub report?

2009-06-04 Thread David Bolen
Peter Jin writes: > We have an audit system which uses separate tables with similar structure to > store different kinds of activities for a user. We want to report the number > of activities per activity type per user. Still sounds pretty standard in terms of database schema. Can I assume that

Re: [jasperreports-questions] How about loop a sub report?

2009-06-05 Thread Peter Jin
Hi David, Thanks for your reply. Union is ok, but seems there are issues with Join. SELECTid, name, count(a1.distance) as a1_cnt, sum(a1.distance) as a1_total, count(a2.hits) as a2_cnt, sum(a2.hits) as a2_total, count(a3.weight) as a3_cnt, sum(a3.

Re: [jasperreports-questions] How about loop a sub report?

2009-06-05 Thread David Bolen
Peter Jin writes: > Let's take a look at activity1 and activity2. If activity1 has more records > than activity2, some of the records of activity2 will be joined multiple > times. This is incorrect. Does it make sense? Drat, yes, dumb error (and obviously too quick 'n dirty test data) on my part

Re: [jasperreports-questions] How about loop a sub report?

2009-06-05 Thread Peter Jin
Hi, It works! All your posts are of great help. Thanks a ton! David Bolen-2 wrote: > > Peter Jin writes: > >> Let's take a look at activity1 and activity2. If activity1 has more >> records >> than activity2, some of the records of activity2 will be joined multiple >> times. This is incorrect.