Skip to Content
avatar image
Former Member

Amount in words in crystal report if null values

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.

Add comment
10|10000 characters needed 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)

  • Get RSS Feed

2 Answers

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

    Can anyone help me?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10, 2017 at 12:55 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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