Click to See Complete Forum and Search --> : Formula Problem


Bill Crawley
November 10th, 2008, 05:27 AM
Hi Guys,

I have the following formula:

local StringVar text = "";
local StringVar Telephone = "" ;
local StringVar Email = "";
local StringVar UserName = "";
local StringVar Address = "";

if not IsNull({PPMQ2GetPORep;1.ProductionControllerUserName}) then
UserName = {PPMQ2GetPORep;1.ProductionControllerUserName};

if not IsNull({PPMQ2GetPORep;1.LocationAddress}) then
Address = {PPMQ2GetPORep;1.LocationAddress};

if not IsNull({PPMQ2GetPORep;1.ProductionControllerTelephoneNumber}) then
Telephone = {PPMQ2GetPORep;1.ProductionControllerTelephoneNumber};

if not IsNull({PPMQ2GetPORep;1.ProductionControllerEmailAddress}) then
Email = {PPMQ2GetPORep;1.ProductionControllerEmailAddress};


text := text + UserName + chr(10) + chr(13) + Address + chr(10) + chr(13) + "Tel: " + Telephone + chr(10) + chr(13) + "Email: " + Email ;

ToText(text);

Some of my fields may contain Null hence my test. On the particular Record that I am testing with, I know that UserName and Location have values, but telephone and email are NULL.

When it print's text, userName and Address is not populated.

Bill Crawley
November 10th, 2008, 05:30 AM
Doh... Forgot the ':' on the = sign.

jggtz
November 10th, 2008, 02:33 PM
You can consider the following to avoid the use of formulaes :

File / Options / Reporting tab / check Convert datbase NULL values to Default
or
File / Report Options / check Convert datbase NULL values to Default