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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine Multiple Records 3

Status
Not open for further replies.

mattz196

Technical User
Jan 30, 2004
8
AU
I would be most grateful if anyone could help me with the following which try as i might i can not work out.

I would like to combine the data of multiple records to a new field to enable me to print across the page. eg

9001 red
9001 blue
9001 green

I would like to print as 9001 red, blue , green

Thanks in advance

Matt
 
Insert a group on {table.number}--the field with the 9001 result. Then create three formulas:

//{@reset} for the group header:
whileprintingrecords;
stringvar colors := "";

//{@colors} for the detail section:
whileprintingrecords;
stringvar colors := colors + {table.color} + ", ";

//{@displaycolors} for the group footer section:
whileprintingrecords;
stringvar colors;
left(colors, len(colors)-2);

Drag the group name into the group footer next to the display formula to get the desired result. Then suppress the details section.

-LB
 
Here is an alternative way:

Create a CrossTab with {Product_ID} (let's assume 9001 is Product_ID) as rows and {Color} as columns.
As crosstab data select the {Color} and simply change the default summary operation from "Count" to "Maximum".

Then, just format the crosstab to suppress the grand totals.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top