web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Tina Menezes Blog / Procedure to display the Am...

Procedure to display the Amount in Words in a report of Microsoft Dynamics NAV

Tina Menezes Profile Picture Tina Menezes 2,582

Introduction:

In this article, I will be explaining the procedure to display amount in words in a report of Microsoft Dynamics NAV.

Pre-Requisite:

Microsoft Dynamics NAV 2016

Procedure:

Step 1:

Declare the following variables in C/AL Globals:

  1. RepCheck’ is a variable of DataType ‘Report’ and Subtype ‘Check’ which is Report 1401.
  2. NoText’ is a variable of DataType ‘Text’ with Dimensions Value as 2 which is set by navigating to the properties of the ‘NoText’ variable.
  3. AmountInWords’ is a variable of DataType ‘Text’ which will store the final result of the amount in words.

Step 2:

Now in my custom purchase order report, I want to display the Amount to Vendor in Words.

In the Purchase Header – OnAfterGetRecord() trigger, I have put the following code:

I have declared a variable ‘AmountVendor’ of DataType ‘Decimal’ in which I will be storing the ‘Amount to Vendor’. I have rounded off the Amount to 2 decimal places.

AmountVendor := ROUND(“Purchase Header”.“Amount to Vendor”,0.01);

Now add the following code to display the Amount in Words:

RepCheck.InitTextVariable;
RepCheck.FormatNoText(NoText,AmountVendor,"Purchase Header"."Currency Code");
AmountInWords:=NoText[1];

So the complete code looks like below:

image001

 Step 3:

Now get the variable ‘AmountInWords’ under the DataSource ‘Purchase Header’ in the report and display it in the design layout of the report.

After saving and running the report the Amount to Vendor will be displayed in Words as shown below:

image003

Conclusion: Thus using the above procedure with the Report 1401 i.e. ‘Check’ report, the amount can be displayed in words in any report of Microsoft Dynamics NAV 2016.



This was originally posted here.

Comments

*This post is locked for comments