Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formatting Data Post Reply Post New Topic
Author Message
vijayk
Groupie
Groupie


Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Quote vijayk Replybullet Topic: Formatting Data
     Posted: 01 Apr 2008 at 1:21pm
Hi,
 
I have the data in the database as follows.
 
Rec No  Plant No
01         011
02         014
03         016
 
..etc
 
But When I want to display the plant No in the report. I want to display the list as
 
011,014,016 instead of
 
011
014
016.
 
Any ideas of how we can achieve this.?
 
Thanks
Vijay
IP IP Logged
andymc
Newbie
Newbie
Avatar

Joined: 17 Mar 2008
Location: United States
Online Status: Offline
Posts: 18
Quote andymc Replybullet Posted: 01 Apr 2008 at 1:52pm
You can do this with three formulas:
 

A.   In the 'Group Header' place the @reset formula:

    WhilePrintingRecords;
    StringVar result := "";

    NumberVar flag := 1


B.   In the 'Detail' section place the @createResult formula


    WhilePrintingRecords;
    StringVar fld := {table.field};                
    StringVar result;
    NumberVar flag;

    if flagt = 1 then
        (
        flag := 2;
        result := fld
        )

    else
         result := result + ", " + fld

// You'll want to suppress the detail section

C.  In the 'Group Footer' section, place the @Display formula:

    WhilePrintingRecords;
    StringVar result;

    result
Andymc
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