views:

737

answers:

1

How can I use multiple groups -which are not nested! - in Crystal Reports?

A little Example of what i want to do:

-hire car header
--rentals header (group)
---rental from 01-02-2008 to 01-06-2008
---rental from 01-08-2008 to 01-09-2008
---rental from 01-12-2008 to 01-15-2008
--rentals footer
--repairs header (group)
---repair from 02-02-2008 to 02-05-2009
--repairs footer
-hire car footer

hire car is the normal report and rentals and repairs are the groups. the groups are not nested. My current problem is that i cnat really create something like that and i cant change the structure to solve this problem... I'm totally new to crystal reports and I'm sorry if thats a pretty studip question^^

+1  A: 

That's a good question. I would call that a double one-to-many. You have "hire car" which can have many rentals and/or many repairs.

One solution would be to use two sub-reports for the rentals and repairs.

Another solution would be to union together the repairs and rentals. Then have crystal group on the column that specifies if the row is rental or repair data. You would also have to show/suppress the correct labels, fields, etc. This get's very clunky so your best bet is to go the sub-report route.

dotjoe
Thanks for that answr, thats what i thought about too... For that case i know used a subreport for the repairs because i had the rentals already finished when i discovered this problem. But in future i will use 2 subreports in a case like this i think...
Gushiken
Actually, I would probably do the same...join the repairs in the main report and group by them. Then, in the car footer add the rentals sub-report. It's usually faster to join the tables as opposed to running a sub-report.
dotjoe