Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Concatenate text lines Post Reply Post New Topic
Author Message
tdrio
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Portugal
Online Status: Offline
Posts: 5
Quote tdrio Replybullet Topic: Concatenate text lines
    Posted: 07 Aug 2008 at 5:07am
Hi,
 
I need help in one topic
 
I have this kind data in my report
 
Category | Desc  (text) |     Value
 
1              | aa               |        10
1              | bb               |        15
1              | cc                |        12
2              | dd               |        14
2              | ee               |        16
3              | ff                 |        12
 
the number of lines per category can be always diferent.
 
and i would like to have a resume report like this
 
Category | Desc  (text) |     Value
 
1              | aa , bb, cc  |        37
2              | dd , ee       |        30
3              | ff                |        12
 
I have grouped by category, and in value there is no problem is a sum. But for description i need help as the number of lines in details can vary.
 
Can anyone help me?
Thanks
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 08 Aug 2008 at 3:34am
I haven't tried this but I'd do something like this.
 
Create a formula
 
shared stringvar desc_list;
desc_list := desc_list & ', ' & desc
 
and put it in the Detail line.  (Suppress it if you  are showing the detail line and don't want to see it accumulate)
 
Then put a formula in the Group Footer that says
 
shared stringvar desc_list;
 
This should have your list ready to be shown.
 
You will also have to reset it for the next category so you put a formula in the Group Header that says
 
shared stringvar desc_list;
desc_list := ''
 
Hope this helps
IP IP Logged
tdrio
Newbie
Newbie
Avatar

Joined: 07 Aug 2008
Location: Portugal
Online Status: Offline
Posts: 5
Quote tdrio Replybullet Posted: 08 Aug 2008 at 4:13am
Hi,
 
Thanks that was exactly what i nedeed.
Already in production.
 
Thank you very much.Thumbs%20Up
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.017 seconds.