Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Concatenating records... Post Reply Post New Topic
Author Message
trentz
Newbie
Newbie
Avatar

Joined: 19 Jun 2012
Location: Australia
Online Status: Offline
Posts: 16
Quote trentz Replybullet Topic: Concatenating records...
    Posted: 10 Sep 2012 at 7:04pm
Hi all,
I've managed to create a variable that is a concatenation of a bunch of records, using:


WhilePrintingRecords;
@BuildRecords // name of formula
stringvar concatRecs;
if RecordNumber = 1
then( concatRecs := concatRecs + {table.field}; )
else( concatRecs := concatRecs + ", " + {table.field}; );


And then printing the results with:

EvaluateAfter({@BuildRecords});
stringvar concatRecs := {@BuildRecords};
concatRecs;


... the only problem is, it prints the variable after every iteration, such that the first line has one record, the second has two, and so on.. I only want to print the last one. Any ideas?

Edited by trentz - 10 Sep 2012 at 9:00pm
A world of unexamined lives is a waste of a world!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 11 Sep 2012 at 9:10am
I answered in another forum.
 
as a note, concatRecs is shared, so there is no need to assign it a value when you are printing it.
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.016 seconds.