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

Announcements

News and Announcements icon
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
    Microsoft Employee 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
    IB-29041624-0 Profile Picture
    1,191 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,314 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,781 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,356

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans