Options

Dispay the Amount converted to Words in the Report Body

ChetanChetan Member Posts: 15
Dear Experts,

I am designing a document report. I am successfully able to retrieve Company & Customer details and display on the Report header. Also, I am able to retrieve item details and display on the Report body.

One of the user requirement is to convert total amount and display in words. I have converted the amount into words using Check->Report, but my issue is I am not able to display same on Report body.

I have defined an variable AmountInWords in DataItem - "Sales Invoice Line".

I am calculating the sum of row amount in "Sales Invoice Line" - OnAfterGetRecord() and I am assigning the final amount to AmountInWords in "Sales Invoice Line" - OnPostDataItem().

Could any help me, why am I not able to display the amount converted to word in the report header. Many Thanks for your help in advance.
Chetan
Bangalore

Answers

  • Options
    NAVRSNAVRS Member Posts: 7
    if I understand correctly, you are able to convert the amount to text but it is not printing on the header, could you let me know are you using Code.Setdata, Getdata functions to print the "Amountinwords" in the report header?
  • Options
    ChetanChetan Member Posts: 15
    Hi NAVRS,

    Thanks for your response.

    Actually I have used SetData & GetData for Company & Customer details in report header.
    Please make a correction to above statement, I want to print the Words in the Report Body.

    When I assign the required words to AmountInWords variable, it is not passed to it in the DataSet(Report Screen -> Help -> About This Report).

    Could you please through some light on this. Many Thanks.
    Chetan
    Bangalore
  • Options
    NAVRSNAVRS Member Posts: 7
    Can you check are you able to get the Amountinwords in NAV, if yes then check the last line of the dataset (use the last(fields!Amountinwords.value)) to display on the report
  • Options
    ChetanChetan Member Posts: 15
    When I debug, I can see that variable is assigned the value. But when passed to the report dataset it is not applied their.

    I am having only one record, hence cannot consider Last(fields!Amountinwords.value) also.
    Chetan
    Bangalore
  • Options
    NAVRSNAVRS Member Posts: 7
    if the value assigned to Amountinwords then it should pass to the dataset, (can you display message for Amountinwords so you can easily know)
    in which dataitem you have placed the Amountinwords textbox
    can you check placing the code and amountinwords text box OnAfterGetRecord of SalesInvoiceline
  • Options
    ChetanChetan Member Posts: 15
    I guess, since I have passed the value in the OnPostDataItem I am not getting the value in the dataset and also I have only one record, hence I cannot use last value too.

    I have tried placing the AmountInWords variable in both "Sales Invoice Header" and "Sales Invoice Line" and have no result.

    If I place the code in OnAfterGetRecord, it will print the totalamount for each record in that sales invoice line which I dont want.
    Chetan
    Bangalore
  • Options
    NAVRSNAVRS Member Posts: 7
    ok then try placing the code on Sales invoice line Post dataitem and the Amountinwords in the Header dataitem
Sign In or Register to comment.