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

2009-06-06 Thread Peter Jin
Hi, It works! All your posts are of great help. Thanks a ton! David Bolen-2 wrote: Peter Jin jinyup...@gmail.com 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

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,

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 jinyup...@gmail.com writes: Grouping can not solve my issue

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

2009-06-04 Thread David Bolen
Peter Jin jinyup...@gmail.com 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.

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

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

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? --

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

2009-06-03 Thread David Bolen
Peter Jin jinyup...@gmail.com 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