Print Page | Close Window

If Then w. multiple actions

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=22258
Printed Date: 05 May 2024 at 12:28pm


Topic: If Then w. multiple actions
Posted By: SpencerRichman
Subject: If Then w. multiple actions
Date Posted: 03 Mar 2017 at 10:03am
I am trying to use the Formula Workshop to write a formula that will look at a data field and if it isNull, then I want it to (1) enter "MISSING" in the field and (2) highlight the field in yellow.  I am trying the following:

if IsNull({Customers.Address Line 1}) = TRUE then "MISSING" ELSE {Customers.Address Line 1};
if IsNull({Customers.Address Line 1}) = TRUE then cryellow else crNoColor

I am not getting an error message, but nor is it working.  Instead I am getting a large number and the field is not highlighted in yellow.

Any ideas?



Replies:
Posted By: DBlank
Date Posted: 06 Mar 2017 at 2:37am
The background color formula needs to be placed in the location that controls that.
Right click on the field
select format field
select Border Tab
select the formula button (x-2) next tot he Background option
enter your formula there
if IsNull({Customers.Address Line 1}) then cryellow else crNoColor

For your other formula, are you placing the formula field on the canvas or the original address field?
The formula does not alter your data, it is not an update script. You need to use the formula field as your display data. The above format formula needs to be applied to this this formula as well.
Also keep in mind if you have any empty strings this will not change it to 'Missing'



Print Page | Close Window