Print Page | Close Window

Concatenate Details

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Talk with the Author
Forum Discription: Ask Brian questions about his books and give him your comments. Like the book? Hate the book? Have suggestions? Let me know!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20166
Printed Date: 25 Apr 2024 at 5:03pm


Topic: Concatenate Details
Posted By: Lord Yorkshire
Subject: Concatenate Details
Date Posted: 29 Oct 2013 at 12:48am
I have a report where i wish to concatenate the answers i recevie.
 
These are all at Detail Level and the report looks like this
 
Header
Panel Num Score
 
Details
1             164
2             535
3             164
 
i want to end up with a string that says"164+535+164"
 
This could be upto a maximum of 10 scores but i only want to show the appropriate number, i dont want "164+535+164+0+0+0+0+0+0+0"



Replies:
Posted By: kevlray
Date Posted: 29 Oct 2013 at 4:29am
I would create a formula to go in the details something like this.
shared stringvar somestring;
if onlastrecord then
 somestring := somestring + {stringval}+"+"
else
  somestring := somestring

Then have another formula in the report footer
shared stringvar somestring;

If you are grouping the data, you probably would put the second formula in the GF, but then you will need another formula to reset the string to nothing in the GH (example:  shared stringvar somestring :="";)



Print Page | Close Window