move row records to column fields

xcao

Registered User.
Local time
Today, 06:18
Joined
Nov 25, 2003
Messages
40
I have a crystal report like this:

PersonID, Lastname, Site
12, Abbott, A
12, Abbott, B
12, Abbott, F
34, Smith, C
50, Olson, B
50, Olson, E

Basically a person can be in one or more site. (usually one or at most 4 sites.
We totally have 9 sites.)
Now I would like to pull the report this way- basically pull their sites from row to column, one person has one row.
PersonID, Lastname, Site1, site2, Site3, site4
12, Abbott, A, B, F
34, Smith C
50, Olson, B,E


Thanks
 
Does it apply to my case as in my previous message by using cross tab?

I cannot figure out how. The site is string, not number, how to total
 
If i understood the problem correctly then try the below and check the results

Create a group on Person ID,
Create three formula's
@freset
take a shared string variable in @freset place it group header
Shared Stringvar ConcatStr:="";
Take another formula
place in the detail section
@fConcatStr
Shared Stringvar ConcatStr:=ConcatStr + ","+ {Site};

and the final formula
@fDisplayStr
Shared Stringvar ConcatStr;
--use substr to eliminate the last comma.
Substring(ConcatStr,1,len(ConcatStr)-1);

place all the person details in the group footer and suppress the header and detail section

Person id lastname @fDisplayStr in the presonid group footer.
 
Thank you very much.
It is very helpful
 

Users who are viewing this thread

Back
Top Bottom