Amount in words - Passing Parameters

shibilyshibily Member Posts: 89
Hi,
How can i print decimal amount in words. I have tried using report 1401. However i am not sure about the parameters to pass in the function 'FormatNoText' ,Especially the first parameter ' VAR NoText : ARRAY [2] OF Text[80] ' .

Anybody please explain this.

Thanks in advance.

Shibily

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can look at the code in this report 1401, DataItem Integer "PrintCheck", how this function is used:
    FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");
    
    DescriptionLine is a global variable, of type Text80, with 2 dimensions (= array).
    The other parameters are clear I suppose.

    DescriptionLine[1] will contain the first 80 characters of the generated text, while DescriptionLine[2] will contain the other 80 chars.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • shibilyshibily Member Posts: 89
    You can look at the code in this report 1401, DataItem Integer "PrintCheck", how this function is used:
    FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");
    
    DescriptionLine is a global variable, of type Text80, with 2 dimensions (= array).
    The other parameters are clear I suppose.

    DescriptionLine[1] will contain the first 80 characters of the generated text, while DescriptionLine[2] will contain the other 80 chars.
    hi Luc an Dyck,
    Thanks for the reply.
    I tried with the same function. When i call the function what the function expects as the first parameter(DescriptionLine)?

    Thanks
    Shibily
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I said it already in my answer: find the global variable called DescriptionLine in report 1401, and copy this one in your code.

    You can view also the properties for this variable, and then you'll see that it has 2 dimensions.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • codercoder Member Posts: 16
    Hello,

    FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");

    The first parameter of the above function does not expect anything but is a type of variable which will contains the return value of the function. You can display its value in section as DescriptionLine[1] and DescriptionLine[2].

    Regards,
    Rakesh
  • shibilyshibily Member Posts: 89
    Hi,

    I used the following steps


    DescriptionLine[1] := Text021; // Text021=VOIDVOIDVOID
    DescriptionLine[2] := DescriptionLine[1];

    FormatNoText(DescriptionLine,556,amnt); // amnt := Currency.Code (selected USD)
    MESSAGE(DescriptionLine[1]);

    Message i got displayed is " **** HUNDRED AND ZERO ONLY " . I am getting the same output for any amount i pass in the function.

    Please give any suggestions

    Thanks
    Shibily
  • ssinglassingla Member Posts: 2,973
    Run the debugger and check whether any amount is carried to report 1401. It happened with me once when I send a flow field value without using CalcFields.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • shibilyshibily Member Posts: 89
    Hi,
    Currently i am checking by using a new screen by passing the parametrs hard coded .
    I used the functions ' FormatNoText ' and ' AddToNoText ' from the report 1401.

    Thanks
    Shibily
  • shibilyshibily Member Posts: 89
    Hi All,
    I still cant find any solution for this issue.

    Shibily
  • ChetanChetan Member Posts: 15
    Hi All,

    In reference to shibily's post, I am too getting the only message as " **** HUNDRED AND ZERO ONLY " and I am unable to resolve it.

    Could some tell me, how It can be resolved.

    Many Thanks.
    Chetan
    Bangalore
  • ChetanChetan Member Posts: 15
    We are suppose to add the below code before we call the FormatNoText() which will initialize the text and then will display the correct wordings.

    CheckReport.InitTextVariable;

    CheckReport is of Type "Report" and subtype "Check".
    Chetan
    Bangalore
Sign In or Register to comment.