Skip to Content
0

Amount in words in crystal report if null values

Apr 09, 2017 at 10:32 AM

83

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
Former Member

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)

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Apr 09, 2017 at 02:06 PM
0

Can anyone help me?

Share
10 |10000 characters needed characters left characters exceeded
Edy Simon Apr 10, 2017 at 12:55 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

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

0