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 :
Small and medium business | Business Central, N...
Suggested Answer

Custom Report Blob field empty on print - Except Preview

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I'm having trouble identifying the problem here. I've got a report that predates report extension, along with a table extension with a blob field on Purchase Header table. When the report is sent to preview, my blob field comes out filled (is intended to work like "Work Description" from sales header), but when the report is sent to attachments or printed to PDF, the Blob field is always empty. 

The DataItem that should print the lines: 

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

                trigger OnAfterGetRecord()
                var
                    TypeHelper: Codeunit "Type Helper";
                begin
                    if WorkDescriptionLines.Number <> 1 then
                        if WorkDescriptionInstream.EOS then
                            CurrReport.Break();

                    WorkDescriptionLine := TypeHelper.ReadAsTextWithSeparator(WorkDescriptionInstream, TypeHelper.LFSeparator);
                end;

                trigger OnPostDataItem()
                begin
                    Clear(WorkDescriptionInstream)
                end;

                trigger OnPreDataItem()
                begin
                    if not ShowWorkDescription then
                        CurrReport.Break();
                    Header."Work Description Blob".CreateInStream(WorkDescriptionInstream, TextEncoding::UTF8);
                end;
            }
The field has the calcfields set onaftergetrecord from the parent DataItem. 
Anyone got a similar problem recently? I'm been going around in circles trying to understand.
Would appreciate any help at all.
Thank you.
I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    You will not find any data in the blob on the OnPreData item trigger.

    You will have to use the onaftergetrecord trigger or you will have to fetch the spesific record you need and then do calcfields on that.

    The code you have provided is that the complete code for the report?

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

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 2,468

#2
YUN ZHU Profile Picture

YUN ZHU 923 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans