Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of Group Expert

Status
Not open for further replies.

bether

Programmer
Jan 3, 2007
28
US
Hello,

I’m developing a Crystal report using Visual Studio 2005. My datasource is tied directly to the database table.
The database table has the following columns: Group, Subgroup, and CompanyName. Sample data is as follows:

Group Subgroup CompanyName
ABC Example Example Co
ABC ABC ABC Co
ABC Another Another abc Co
XYZ XYZ XYZ Co
EXA EXA EXA Co

With the example data above, its saying that Group “ABC”, has 2 subgroups, “Example” and “Another”

In the report, I would like to display it in the following manner:

Group Company Name
ABC ABC Co
Example Example Co
Another Another abc Co
XYZ XYZ Co
EXA EXA Co

I was able to create it in this manner by creating groups (one for Group column, another for Subgroup) using the Group Expert. It is grouping it correctly. However, the company name showing for ABC is not ABC Co, but Example Co. It seems to be taking the first occurence of CompanyName from the database that has a Group ABC. In this case, it is "Example Co" (see following).

Group Company Name
ABC Example Co
Example Example Co
Another Another abc Co
XYZ XYZ Co
EXA EXA Co


How can I have the report display the correct name for Group "ABC", which is "ABC Co"?

Thank you so much for your time.



 
Create a formual that concatenates Group and SubGrup
@Group
{Groupfield}& {subGroupField}

Then group on that formula as group 1, delete group 2.

Ian
 
Have you looked at the customize group name feature? I cannot test anything but I am sure the answer lies there.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Guys, thank you so much for your swift responses. I'm working on it now, using your ideas. Thanks again.
 
Hello,

I tried using the concatenation, but that won't apply for my case. Im trying to show the data in group and subgroup, where the subgroup is indented. This is not being achieved by just concatenating. I guess I have to play around further with formulas and grouping. Any other help would be greatly appreciated.

Thanks.
 
Try adding the table a second time, linking {table.subgroup} to {table_1.group}. Then insert a group on {table._1.group} and a second group on {table.subgroup}. You could then suppress group 2 with:
{table_1.group} = {table.subgroup}.

There is also a hierarchical grouping option, which is a little tricky to work with. Not sure whether this would meet your needs or not.

-LB
 
Thank you.

I tried this and it still didn't work. I think with all your ideas, I am closed just couldn't get into it.

Maybe I should just redesign the table so that when I group it, the data will come out the way I expect it to behave. I think this can be done having a different table structure, just couldn't get my mind onto it.

Any ideas on how the table should be structured to get the desired results would be greatly appreciated.

Again, thank you.


 
Instead of saying something didn't work, you should explain in what way, so that further responses can be built on previous ones.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top