Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Displaying data horizontally vs. vertically Post Reply Post New Topic
Author Message
crystalsonic
Groupie
Groupie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 46
Quote crystalsonic Replybullet Topic: Displaying data horizontally vs. vertically
     Posted: 29 Mar 2012 at 11:30am

I need to display some of the information horizontally and separated by a comma vs. vertically. This is what the report looks like:

C C090 GLUCOSE TOLERANCE GTT GTT GTT 24 GL
SE
C C1010 GLUCOSE FASTING GLU-FBS GLU-FBS GLU-FBS Glucose Fasting F7 mg/dL
C C1011 GLUCOSE 1/2 HR GLU-1/2HR GLU-1/2HR GLU-1/2HR Glucose 1/2 Hr F7 mg/dL
C C1012 GLUCOSE 1 HR GLU-1HR GLU-1HR GLU-1HR Glucose 1 Hr F7 mg/dL
C C1013 GLUCOSE 2 HR GLU-2HR GLU-2HR GLU-2HR Glucose 2 Hr F7 mg/dL
C C1014 GLUCOSE 3 HR GLU-3HR GLU-3HR GLU-3HR Glucose 3 Hr F7 mg/dL
C C1015 GLUCOSE 4 HR GLU-4HR GLU-4HR GLU-4HR Glucose 4 Hr F7 mg/dL
C C1016 GLUCOSE 5 HR GLU-5HR GLU-5HR GLU-5HR Glucose 5 Hr F7 mg/dL
C C1017 GLUCOSE 6 HR GLU-6HR GLU-6HR GLU-6HR Glucose 6 Hr F7 mg/dL
C C091 GLUCOSE PLASMA GLUC-P GLUC-P GLUC-P 24 GL
SE
C C0910 GLUCOSE PLASMA GLUC-P GLUC-P GLUC-P Glucose Plasma F7 mg/dL
 
The data in bold for the 8th column originates from the same table. I would to combine the GL and SE and display them separated by a comma. That part of the report is set up via a subreport. This is how I would like for the report to look:
C C090 GLUCOSE TOLERANCE GTT GTT GTT 24 GL,SE
C C1010 GLUCOSE FASTING GLU-FBS GLU-FBS GLU-FBS Glucose Fasting F7 mg/dL
C C1011 GLUCOSE 1/2 HR GLU-1/2HR GLU-1/2HR GLU-1/2HR Glucose 1/2 Hr F7 mg/dL
C C1012 GLUCOSE 1 HR GLU-1HR GLU-1HR GLU-1HR Glucose 1 Hr F7 mg/dL
C C1013 GLUCOSE 2 HR GLU-2HR GLU-2HR GLU-2HR Glucose 2 Hr F7 mg/dL
C C1014 GLUCOSE 3 HR GLU-3HR GLU-3HR GLU-3HR Glucose 3 Hr F7 mg/dL
C C1015 GLUCOSE 4 HR GLU-4HR GLU-4HR GLU-4HR Glucose 4 Hr F7 mg/dL
C C1016 GLUCOSE 5 HR GLU-5HR GLU-5HR GLU-5HR Glucose 5 Hr F7 mg/dL
C C1017 GLUCOSE 6 HR GLU-6HR GLU-6HR GLU-6HR Glucose 6 Hr F7 mg/dL
C C091 GLUCOSE PLASMA GLUC-P GLUC-P GLUC-P 24 GL,SE
C C0910 GLUCOSE PLASMA GLUC-P GLUC-P GLUC-P Glucose Plasma F7 mg/dL
C C100 GLUCOSE GLUCOSE GLUCOSE GLUCOSE 24 GL
C C1000 GLUCOSE GLUCOSE GLUCOSE GLUCOSE Glucose F7 mg/dL 2345-7
 
Any ideas on how to accomplist this? I am not even sure if this can be done. I am rewritting a repor that somebody else wrote. THANKS!!!
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 29 Mar 2012 at 11:04pm
It just looks like there are some blank sections in your subreport. If so, just suppress these sections.
IP IP Logged
crystalsonic
Groupie
Groupie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 46
Quote crystalsonic Replybullet Posted: 30 Mar 2012 at 4:40am
Yes, it is adding extra lines because of the second entry that exists for the 8th column. If am afraid if I suppress it, it will not display the second entry. This is the reason, I am trying to display those entries horizontally.
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 30 Mar 2012 at 5:09am

You could try uisng the next function to merge them together, I've never actually done this so not sure how well it will work. Someone with more experience in suing next/previous may be able to assist you further.

I assume if you reference one of the columns that comes up blank as a check and if so merge the column with different values.
 
something like;
 
if next({table.columna}) is null
then {table.desccolumn} & ", " & next({table.desccolumn}
else {table.desccolumn}
 
{table.desccolumn} would be the column containing GL or SE etc and the columna would be any other column (provided that your entire dataset follows the sample you posted).
 
You should then be able to conditionally surpress the blank rows.
 
Regards,
Ryan.
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