Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Variables (on detail lines) Post Reply Post New Topic
Author Message
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Topic: Variables (on detail lines)
     Posted: 30 Sep 2013 at 5:42am
Have a report I need to use variables on (to fetch insurance companies for a patient visit, Primary, Secondary, Tertiary) I'll just type in primary here, for simplicity.

This is how I normally set up the variables when I group on patient visit:

GH1 - suppressed: @Primary_Reset

Code:
shared stringvar Primary := " ";

D - suppressed: @Primary_Variable_Declaration

Code:
shared stringvar Primary;
if {TPM311_VISIT_PAYOR.pyr_seq_no} = 4981 then
Primary := {TPM700_PAYOR_PLAN.plan_ds};

GF1 - Data Line: @Primary_Display

Code:
WhilePrintingRecords;
shared stringvar Primary;
Primary

This works great when I group. But in this instance I need the data on a detail line. Doing this:

Da: - suppressed - @Primary_Reset
Db: - suppressed - @Primary_Variable_Declaration
Dc: - data line - @Primary_Display

and when looking at the results, it looks like I am not resetting correctly, or something else is going on.

Anything I am missing here?

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 30 Sep 2013 at 6:52am
I cannot say for sure, but since you are not grouping I think you could get rid of the shared variable and just keep the formula (one detail line, unless you are doing some other calculations in the other detail lines).  Example:
 if {TPM311_VISIT_PAYOR.pyr_seq_no} = 4981 then
 {TPM700_PAYOR_PLAN.plan_ds}
IP IP Logged
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Posted: 30 Sep 2013 at 7:12am
The problem with doing that is that if there is a Secondary Insurance present on the patient account, the primary won't show in the record. if there is a tertiery insurance present, the primary or the secondary won't show up.

Edited by TorLang - 30 Sep 2013 at 7:15am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 30 Sep 2013 at 8:47am
Not sure what is going on.  I tested the concept on a database I work with and your formulas appear they should work.
IP IP Logged
TorLang
Groupie
Groupie


Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
Quote TorLang Replybullet Posted: 03 Oct 2013 at 8:43am
I "figgerd" it out. Thanks.
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