Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Set Global Variable Post Reply Post New Topic
Author Message
bshort1023
Newbie
Newbie
Avatar

Joined: 18 Jan 2012
Location: United States
Online Status: Offline
Posts: 18
Quote bshort1023 Replybullet Topic: Set Global Variable
     Posted: 07 Mar 2013 at 6:46am
I want to set a global variable with the customer name of the first detail record.  For each record I want to compare the customer name from the current detail record with the global variable.  If they are the same I want to suppress the customer name.  If they are different I do not want to suppress but I then want to change the global variable to the current customer name.

I have tried the following code in the Suppress section of the customer name field.  Nothing is suppressed using this code though some fields should be.

If OnFirstRecord Then Global StringVar CustName = {BAQReportResult.Customer.Name};

If Not OnFirstRecord AND {BAQReportResult.Customer.Name} = CustName Then
        True
    Else
        False AND CustName = {BAQReportResult.Customer.Name};

Thanks,

Bill
Newtown, PA
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Mar 2013 at 11:03am
do you mean you just want to suppress duplicate names on sub sequent rows?
ther is a check box for that in the Format Field  common tab.
IP IP Logged
bshort1023
Newbie
Newbie
Avatar

Joined: 18 Jan 2012
Location: United States
Online Status: Offline
Posts: 18
Quote bshort1023 Replybullet Posted: 08 Mar 2013 at 3:06am
Sorry, I should have explained that I am already suppressing some records based on another criteria.  Even though it is suppressing those records it apparently is still taking them into account when I check the box to suppress duplicate names on subsequent rows.  So if the first record in a group is suppressed based on my criteria the second record suppresses the customer name field because it is a duplicate of the previous record.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Mar 2013 at 6:36am
maybe using whileprintringrecords?
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