Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Displaying Column Horizontally Post Reply Post New Topic
Author Message
CR-Help
Newbie
Newbie


Joined: 29 Aug 2013
Online Status: Offline
Posts: 9
Quote CR-Help Replybullet Topic: Displaying Column Horizontally
     Posted: 16 Sep 2013 at 3:28am
Hi guys,

I'm trying to display the name of an individual plus their credentials but I'm fairly new to Crystal so I could use some help here if you got time. The issue is if they have multiple credentials it only displays one

Currently in the report footer I have

main report includes a subreport, within the subreport the report header has the following:

{fullnameFIELD} + ", " + {CredentialFIELD}

John Doe, MD

if this individual has multiples credentials I'd like for it to display in this manner:

John Doe, MD, PhD

I'd imagine I should apply the credentials field to the details, but that would leave the fullnamefield above it and not formatted correctly. The other part is getting it to show up horizontally with the correct formating by separating it with ", " Any help would be appreciated it!



Edited by CR-Help - 16 Sep 2013 at 3:30am
IP IP Logged
CR-Help
Newbie
Newbie


Joined: 29 Aug 2013
Online Status: Offline
Posts: 9
Quote CR-Help Replybullet Posted: 16 Sep 2013 at 6:00am
Anyone know if I can format a field with a subreport that only uses the details section with only a field inside of it?

{fieldname}+subreport?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Sep 2013 at 6:44am
you don't need a subreport...at least I wouldn't use one.

In the group header (and group header can be suppressed) have a formula like:
shared stringvar credentials := "";

in the detail section, again the section can be supressed
shared stringvar credentials;
credentials := credentials + ", " + {table.field}
""//will hide the formula if the section is not suppressed

finally, in the group footer...
shared stringvar credentials;
mid(credentials, 3) //will trim off the leading ', '

HTH
IP IP Logged
CR-Help
Newbie
Newbie


Joined: 29 Aug 2013
Online Status: Offline
Posts: 9
Quote CR-Help Replybullet Posted: 16 Sep 2013 at 7:04am
This worked very very well for me, that I had to do some hands stands at the office.  The last thing I needed to do was to create another formula so that I could apply the fullname field to the credential formula.

Question for you is, how did you know about "shared stringvar" Also is there a book that I can buy that will allow me to grow as a Crystal Reports creator? I'd like to go with whatever resource you used since you were the one who successfully got me through this obstacle.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Sep 2013 at 7:08am
I've been doing this for years and found shared variables a long time ago using Crystal Reports help and their website.

The best book that I have seen is Brian's, and it helped through a couple of issues, which is one of the reasons that I support this site. I don't know if it is still available. I am sure that Brian will have more info on that.

Glad I could help.
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