Print Page | Close Window

Need a formula

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
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=13804
Printed Date: 02 May 2024 at 12:13pm


Topic: Need a formula
Posted By: mjawadkhatri
Subject: Need a formula
Date Posted: 19 Jul 2011 at 10:18am
Hi, I need Some help. i have report which generate invoice, there is two amount field one in $ and other is PK , In $ field always some value but some time pk field is null,

Now

i need some formula which is check,when PK field is null then convert $ field in word else  convert pk field

hope you are understand my question

I use blow formula to convrt number into word this formula working perfectly

currencyvar tt;
currencyvar dect;
tt :={ship.comm_amount};
dect := tt - Truncate(tt);
tt := truncate(tt);
dect := dect * 100;
if dect = 0 then
UPPERCASE('$ ' + ToWords (tt,0 )) + ' ONLY'
else
UPPERCASE('$ ' + ToWords (tt,0) + ' And CENT ' + ToWords(dect,0)) + ' ONLY ';


Thanks in advance




Replies:
Posted By: lockwelle
Date Posted: 21 Jul 2011 at 7:51am
if isnull({table.pk}) then
  tt:={table.pk}
else
 tt:={table.$}
 
or something similar
 
HTH



Print Page | Close Window