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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Why are integer tables used in reports for BLOB fields?

(0) ShareShare
ReportReport
Posted on by 117

Hello everyone,

can someone explain to me why standard reports use integer tables to display the text from BLOB fields. Such as the work description in sales quotes:

report 1304 "Standard Sales - Quote"
{
    ...

    dataset
    {
        dataitem(Header; "Sales Header")
        {
            ...

            dataitem(WorkDescriptionLines; "Integer")
            {
                DataItemTableView = SORTING(Number) WHERE(Number = FILTER(1 .. 99999));
                column(WorkDescriptionLineNumber; Number)
                {
                }
                column(WorkDescriptionLine; WorkDescriptionLine)
                {
                }

                trigger OnAfterGetRecord()
                begin
                    if WorkDescriptionInstream.EOS then
                        CurrReport.Break();
                    WorkDescriptionInstream.ReadText(WorkDescriptionLine);
                end;

                trigger OnPostDataItem()
                begin
                    Clear(WorkDescriptionInstream)
                end;

                trigger OnPreDataItem()
                begin
                    if not ShowWorkDescription then
                        CurrReport.Break();

                    Header."Work Description".CreateInStream(WorkDescriptionInstream, TEXTENCODING::UTF8);
                end;
            }

            ...

            trigger OnAfterGetRecord()
            begin
                ...

                CalcFields("Work Description");
                ShowWorkDescription := "Work Description".HasValue;

                ...
            end;
        }
    }

    ...

    var
        WorkDescriptionInstream: InStream;
        WorkDescriptionLine: Text;
        ShowWorkDescription: Boolean;
    
    ...
}

Why not just use the Sales Header's GetWorkDescription function, like the card page does:

report 1304 "Standard Sales - Quote"
{
    ...

    dataset
    {
        dataitem(Header; "Sales Header")
        {
            ...

            column(WorkDescription; Header.GetWorkDescription())
            {
            }

            ...
        }
    }

    ...
}

I would be interested to know what advantages you (or Microsoft) see in the first variant. Or what disadvantages I overlook in my proposal.

Thank you for your help and best regards
Nico

  • Verified answer
    NAV_with_Narang Profile Picture
    2,410 Moderator on at

    If the method you described is giving you the desired result then go for it. There can be multiple ways to reach a destination, with each having it's own pros & cons. To the best of my understanding, not just this instance, but Microsoft uses a lot of Integer in a lot of reports. It can be due to a handful of reasons:

    1. Probably a report is carried forward/migrated from the earliest of NAV days - I am talking about 1990's. Yes such reports exist, in which the design of the overall report has not changed but minor tweaks have been added. Probably in those early days of C/AL the best way to retrieve such records was only through the Integer dataitem, so it has been used till date. You ask why? - You don't change the code until it works!

    2. Many a times, Microsoft keeps in mind efficiency to the top most. In your code, the result will appear 2 seconds later than what Microsoft has written, probably not! But largely, the purpose of MS using integers is to loop through dataitems really quickly as unlike other dataitems, integers don't have any additional columns to deal with when reading a table, it just skims fast giving the report a "feel" of iterating through a table record without actually doing so

    Other community members may also chime in with their views, however the real reason behind the design may stay mystery

  • Suggested answer
    YUN ZHU Profile Picture
    103,164 Super User 2026 Season 2 on at

    Hi, I agree with Rahul, there is nothing wrong with the second method.

    And the following is a brief introduction about Integer Dataitems, hoping to give some hints.

    http://harikiran-in-nav.blogspot.com/2020/01/why-and-when-do-we-need-to-use-integer.html

    Thanks

    ZHU

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

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 710 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 387 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 385 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans