Skip to main content

Notifications

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.
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Custom Report Blob field empty on print - Except Preview

    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?

  • Suggested answer
    Andy Sather Profile Picture
    on at
    RE: Custom Report Blob field empty on print - Except Preview

    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.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans