Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Test for a Suppressed Feild

Status
Not open for further replies.

Jhankins

Programmer
Jun 17, 2003
46
AU
Can you test for a field is suppressed??

I would like to see if a field is suppressed and then change the color of another field.

Cheers,
 
If you mean if a field is conditionally suppressed then change the color of another field, you could. Just use the same criteria you used to conditionally suppress the first field and use it in your formula to conditionally color the background of the second field. For example, let's say you have suppressed {table.EmplID} by entering the following formula in the x+2 area for field suppression:

{table.EmplID} in 123 to 456

If you want to change the color of {table.location} for rows that have this suppressed field, then right click on {table.location}->change border->background->X+2 and enter:

if {table.EmplID} in 123 to 456 then cryellow else crnocolor

-LB
 
Will try and explain in greater detail.

I have 2 SQL queries returning data.

i.e

Query 1 Query 2
returns
id Name ID Type Qty
1 Joe 1 ACME1 5
1 ACME2 4

I want to display in the report:

id Name Type Qty
1 Joe ACME1 5
1 ACME2 4 But i want to display ACME2 in color based on Joe being suppressed. Can it be done?


 
How do you know that Joe is suppressed? Are you conditionally suppressing this field or do you have "suppress if duplicated" turned on?

Also how are you sorting the report? By ID or Name? Can we assume that ID 1 will always be Joe?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
I don't think Crystal has any mechanism for telling you which fields are suppressed, short of looking at the suppression section. Moreover, tests that occur at the same stage in the logic cycle cannot refer to each other--that's why you can't sum sums or suppress blank subreports, at least not directly.

You need to follow lbass's advice, repeat the same test that does the suppression. Or else turn the test into a formula field and test it both places.

Madawc Williams
East Anglia, Great Britain
 
Format the field featuring ACME, and enter the following colour condition:

Not OnFirstRecord;
If {ID} = Previous({ID})
Then CrRed Else CrNoColor

Naith
 
Thanks for all your support. Ibass and Naith used both your solutions and they worked well.

Cheers and ty once again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top