cancel
Showing results for 
Search instead for 
Did you mean: 

Concatinating Field value in Crystal report

Former Member
0 Kudos

hi all,

if we have four fields in report like

ItemCode Item Name Color Thickness

111 Abc Green 1

111 Abc Gray 1

111 Abc Pink 1

three fields itemcode,itemname and thickness are having same values but value in color filed is not same that why returning 3 rows.

But I want to show the result in One row as

ItemCode Item Name Color Thickness

111 Abc Green,Gray,Pink 1

How I can Do this.

Please Help Its Urgent

Thanks

Neetu

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member260594
Active Contributor
0 Kudos

Group on Item Code and then create a string running total incuding a separator for the color in the details section and a display formula in the Group Footer to display the running total results. If there is going to be more than 1 Item Code in the report then you will need to create a formula to reset the running total value.

For example;

String Running Total in the details section;

WhilePrintingRecords;

stringvar clr:= clr + {color field} + ',';

mid(clr,length(clr)-1)

The last line will get rid of the comma separator at the end of the string.

Display Formula in the Group Footer;

WhilePrintingRecords;

stringvar clr;

{Item Code} + ' ' + {Item Name} + ' '+ clr + ' ' +

Reset Formula in the Group Header;

WhilePrintingRecords;

stringvar clr:= ''

Edited by: Graham Cunningham on Aug 1, 2008 7:48 AM

Former Member
0 Kudos

Group by Item Code

Item Name

Color

Thickness

Then use Underlay Following Sections to get it on one line. You might need to use the array

on the Color.

The Panda

Former Member
0 Kudos

You are going to need an array to store all the values you would want displayed in a single line. After you build that array you will need another formula that will variably pull the values out and print them on a single line.