cancel
Showing results for 
Search instead for 
Did you mean: 

Amount in words in crystal report if null values

Former Member
0 Kudos

Hi Experts,

can anyone let me know how can i use null values in my condition for amount in words in crystal layout?

For example (1):

numbervar Amt:=0;
numbervar chgs:=0;
numbervar pAmt:=0;
stringvar Inwords := "";
chgs := ({Command.Other Charges});
if chgs > 0 then Amt := (Sum({Command.U_SLineTot}) + {Command.Other Charges});
if isnull({Command.Other Charges}) then Amt := (Sum({Command.U_SLineTot}));
Inwords := towords(Amt,0) +" "+ "US DOLLARS ONLY.";
Uppercase(Inwords)

No result. can anyone correct this?

For example (2):

I want to have a formula which give me conditional result. In my command query i have a column called 'other charges' which is sum(LineTotal) from RDR3 table. I want to print this as other charges in my layout and

In Grand total i want to include this as well.

Former Member
0 Kudos

Below one is also not working

numbervar Amt:=0;
numbervar chgs:=0;
numbervar pAmt:=0;
stringvar Inwords := "";
chgs := ({Command.Other Charges});
If Isnull({Command.Other Charges}) then Amt := (Sum({Command.U_SLineTot}) + 0);
Inwords := towords(Amt,0) +" "+ "US DOLLARS ONLY.";
if chgs > 0 then Amt := (Sum({Command.U_SLineTot}) + chgs);
Inwords := towords(Amt,0) +" "+ "US DOLLARS ONLY.";
Uppercase(Inwords)

Accepted Solutions (0)

Answers (2)

Answers (2)

edy_simon
Active Contributor
0 Kudos

Hi Jane,

Can you try

numbervar Amt:=0;
numbervar chgs:=0;
numbervar pAmt:=0;
stringvar Inwords := "";

if isnull({Command.Other Charges}) then
(Amt := (Sum({Command.U_SLineTot})))
else
Amt := (Sum({Command.U_SLineTot}) + {Command.Other Charges});

Inwords := towords(Amt,0) +" "+ "US DOLLARS ONLY.";
Uppercase(Inwords)

Note: I may get the syntax wrong, as i wrote this online.

Regards
Edy

Former Member
0 Kudos

Thanks Edy, it is working now.

From Previous Post, As you suggested i used the parameter DocKey@. It is working for to fetch the running record to preview from sap b1 only if i saved the transaction.

But i am not able to see preview of the layout? How can i see the preview of my layout in sap b1 for sale order without adding the transaction.

edy_simon
Active Contributor
0 Kudos

Hi Jane,

In order to support the preview before the document is added, You may not wrap the document tables in a command.
You will need to design the crystal report by adding each tables into the form.

Regards

Edy

Former Member
0 Kudos

Can anyone help me?