Print Page | Close Window

One row with multiple columns

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22259
Printed Date: 01 May 2024 at 5:55pm


Topic: One row with multiple columns
Posted By: ffarro
Subject: One row with multiple columns
Date Posted: 06 Mar 2017 at 6:35am
Hello everyone, I'm currently having issues with getting different values from one table to one row in different columns.

i currently have 3 columns that each pull different values from the same table. but they appear as 3 rows with only the section filled out, instead of one row with each columns section filled out.

i created 3 formulas one in each columns.

if {sc_Observation.FindingAbbr} = 'W_DMTeachMethod'
then {sc_Observation.Value}

if {sc_Observation.FindingAbbr} = 'W_DMTeachMethod'
then {sc_Observation.Value}

if {sc_Observation.FindingAbbr} = 'W_DMEvalMethod'


and this under select expert record
{sc_Assessment.FormUsageDisplayName} = "Education - Specific" and
{sc_Observation.FindingAbbr} in ["W_DiabetesSelfMa", "W_DMEvalMethod", "W_DMTeachMethod"]
then {sc_Observation.Value}



Replies:
Posted By: kevlray
Date Posted: 06 Mar 2017 at 6:57am
That makes sense to me.  But if you want them all on one row.  The easiest is to find a way to group the results, hide the group header and details and put the data into the group footer.


Posted By: ffarro
Date Posted: 06 Mar 2017 at 7:17am
tried that but wasn't very successful. this is what I currently looks like
Name      Start     Stop   diabself teaching   evalmeth
john doe 1/8       1/9    Health
john doe 1/8       1/9              discussion
john doe 1/8       1/9                          verbal

I would like it as this
john doe 1/8       1/9    Health    discussion   verbal


Posted By: kevlray
Date Posted: 06 Mar 2017 at 9:08am
Looks like you are still not grouping and hiding the group header and details.  Putting all the information in the group footer.  Also you will need to set up three shared variables (one for each formula).

i.e.,
shared stringvar somestringvar;
if {sc_Observation.FindingAbbr} = 'W_DMTeachMethod'
then somestringvar := {sc_Observation.Value};

then you will need another formula to display the shared variable in the group footer.  i.e,

shared stringvar somestringvar;

Also it would probably have a formula in the group header to reset the shared variable(s);

shared stringvar somestringvar := '';

I did not show all the code you needed and just an example of what you could call one of the shared variables.


Posted By: ffarro
Date Posted: 06 Mar 2017 at 9:32am
thank you I will try your suggestions again , the ex I had shown before was just how it looked before any additional config and what I wanted for it to look like. Its been a while since I used crystal so some things are slow to come back to me.




Print Page | Close Window