Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: multiple records as a sentence?? 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: multiple records as a sentence??
     Posted: 10 Sep 2012 at 1:51pm
Many people have asked how to display records horizontally, and I suspect some of these aren't getting what they're looking for, ie multiple records displayed as a single sentence, separated (for example) by commas, ie:

Item1, Item2, Item3....

and that would carry on to the next line in a natural way. Surely, this can be done!?
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: 4374
Quote lockwelle Replybullet Posted: 11 Sep 2012 at 9:04am
the standard for concatenating multiple rows into 1 line is something like:
formula in the detail section:
shared stringvar x;
x := x + ", " + {table.field};
"" //hides the output
 
usually the detail section is suppressed.
 
in the group or the report footer then the following formula is used:
shared stringvar x;
mid(x, 3);   // strips off the leading comma and space.
 
if canGrow is checked, the control should expand in the standard way that CR expands a data column, which is all that can hope for.
 
HTH
IP IP Logged
trentz
Newbie
Newbie
Avatar

Joined: 19 Jun 2012
Location: Australia
Online Status: Offline
Posts: 16
Quote trentz Replybullet Posted: 11 Sep 2012 at 2:52pm
At first glance, this seems to work just fine, but for some reason, with each successive instance of the subreport to which I'm applying this, the value is not reset, eg:
1st instance:
Sponsored by: Accenture, Arup
2nd instance:
Sponsored by: Accenture, Arup, La Trobe University
3rd instance:
Sponsored by: Accenture, Arup, La Trobe University, TRUEnergy, Kojo Group
... and so on.
Why would this happen? How can I overcome it?
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: 4374
Quote lockwelle Replybullet Posted: 12 Sep 2012 at 4:24am
if this is being run for subreports in a group, in the group header add a formula like:
shared stringvar x := "";
"" //will hide the output...not that there is any, guess I am used to numbers that reset to 0
 
HTH
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