Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: dynamic grouping ? Post Reply Post New Topic
Author Message
pchawan
Newbie
Newbie


Joined: 15 Jun 2011
Online Status: Offline
Posts: 4
Quote pchawan Replybullet Topic: dynamic grouping ?
     Posted: 30 Aug 2011 at 4:20am
Hi

I wanted to implement a report in which i have to implement dynamic grouping.

I have to take 3 inputs. All are optional.

If I dont select any grouping then output should be

AAAAAAAA

If I select one grouping then output should be

XX
   AAAA
YY
   BBBB


If I select two grouping then output should be

XX
   CC
     AAAA
YY
   DD
     BBBB


If I select two grouping then output should be

XX
   CC
      KK
        AAAA
YY
   DD
      MM
        BBBB



How can we do it ? Any suggestions ?
Report also involves total at each grouping and final total as well.

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Aug 2011 at 10:18am
What type of parameter are you using?  Do your parameters specify whether to show the group or what the report should be grouped on?
 
I have done this with one level of grouping, but it should be easily extendable to more.
 
Assuming that the parameters indicate whether or not to show the group, try this:
 
1.  Create a formula for each group parameter.  It will look something like this:
 
If {?Show_Group1} then {table.group1_field} else '1'
 
the "else" result in this if statement must be of the same data type as the field you're grouping on.
 
2.  Group by the formula.
 
3.  In the Section Expert, for the group header and footer sections click on the formula button next to the Suppress checkbox (do NOT check the checkbox) and enter:
 
not {?Show_Group1}
 
4.  Put your data in the details and summaries in the group footers.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum