Print Page | Close Window

Combine specific groups to one group name

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=265
Printed Date: 18 May 2024 at 4:23am


Topic: Combine specific groups to one group name
Posted By: techie3
Subject: Combine specific groups to one group name
Date Posted: 01 Mar 2007 at 11:41am
I have a subreport with groups.  Within these different groups; I would like to combine 3 groups into one custom group name and group together.  How do I do that?



Replies:
Posted By: BrianBischof
Date Posted: 01 Mar 2007 at 11:57am
Hmmm.... I would use a formula and concatenate the three fields together. Then only display them within the appropriate groups. If that isn't what you are looking for, then I would create a global variable, and within each group header concatenate the group name onto the global variable. That way you are building the custom group name as the groups get printed.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: techie3
Date Posted: 02 Mar 2007 at 7:26am
I should explain more.  The category is just one field with these possible values.  If I have categories like insurance, medical, food, cable, phone, and electric; and I want to group just the cable, phone, and electric into a group called utilities.  In the report the only groups to show should be:
 
insurance
    insurance detail line1
    insurance detail line2
medical  
    medical detail line1
    medical detail line2
food
   food detail line1
   food detail line2
utilities
    cable detail line1
    electric detail line2
    electric detail line3
    electric detail line4
    phone detail line1
    phone detail line2
    phone detail line3


Posted By: hilfy
Date Posted: 02 Mar 2007 at 10:28am

Quick sample formula to use for your group:

If {table.category field} = 'Cable' then 'Utilities'
else if {table.category field} = 'Electric' then 'Utilities'
else if {table.category field} = 'Phone' then 'Utilities'
else {table.category field}
 
There are other ways of doing this, but this is a quick and dirty example.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: techie3
Date Posted: 04 Mar 2007 at 3:47pm
I set my group to suppress if duplicated but it didnt work.  How do I solve the issue below?


utilities
    cable detail line1
total utilities


utilities
    electric detail line2
    electric detail line3
    electric detail line4
total utilities


utilities
    phone detail line1
    phone detail line2
    phone detail line3
total utilities


Posted By: hilfy
Date Posted: 05 Mar 2007 at 9:25am

Are you grouping on the formula or just using it as the text for the group header?  You need to change the group to work on the formula and NOT on the category field itself.

-Dell



-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: techie3
Date Posted: 05 Mar 2007 at 3:05pm

Finally got it.  I played around and this is what I have:

  1. Used a formula field called @Grpheader and pasted the above if else if ... statement.
  2. Used the same @Grpheader as the Grouping. (Originally I had a field as my grouping.  I changed this in the Group Options Dialog.)
Dell, thank you for your help!


Posted By: raj4uachiever
Date Posted: 30 May 2011 at 12:50am
A




C




X



Y


D
KL


AM



BC PO

E

O




C




R
Like above i want to show result .

if any one have any idea let me know.

Thanks
Rajkumar Gupta



Print Page | Close Window