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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to use the "report" data type?

(0) ShareShare
ReportReport
Posted on by 92

Hello, I am doing an extension of the 1305 report, and I need to show an amount in letters, for which I am following the link below. I am new to Business Central, so some concepts are still not clear to me. How is the report data type supposed to be declared and used? Could you show me some code examples?

It is also not clear to me about the "check" subtype, am I supposed to create a variable that has both the "report" type and the "check" type? How do you do that?

community.dynamics.com/.../procedure-to-display-the-amount-in-words-in-a-report-of-microsoft-dynamics-nav

I have the same question (0)
  • Verified answer
    Tabrez Ajaz Profile Picture
    785 on at

    Hi BchM,

    You can declare a local/global variable using var keyword as shown below:

    var

           RepCheck: Report "Check";

           NoText: array[2] of Text;

           AmountInWords: Text;

    In your case, as you want to display the amount in words the above global variable will help you, the above-mentioned variables are described as follows:

    (1) RepCheck is a variable of  Report DataType Named as "Check" which is 1401.

    (2) NoText is a variable of DataType "Text" with array Dimension value as 2 which is defined as shown above.

    (3) AmountInWords is a variable of DataType "Text" which will store final result of amount in words.

    After declaring the global variables, now you can write your code in OnAfterGetRecord() trigger of DataItem in case of a report or wherever you want to use..

    trigger OnAfterGetRecord()

    var

    begin

      RepCheck.InitTextVariable();

      RepCheck.FormatNoText(NoText, yourDecimalAmountValueFieldOrVariable, CurrencyCode);

      AmountInWords := NoText[1];

    end;

    Now you will have the amount in word in your AmountInWord variable.

  • Suggested answer
    JAngle Profile Picture
    137 on at

    It would be similar to declaring a codeunit var and then calling a procedure. So in the report extension declare a new procedure which has a var of type report for the report 1401 aka Check plus the other required variable. The report is just being used to produce the required value. You could take a copy of the function and put it in the report or just in a codeunit.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,572

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 693 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans