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...
Suggested Answer

AL Excel Report Displaying Null values for Prod. Orders without Comments

(2) ShareShare
ReportReport
Posted on by 10
Hello All, 

I am working on an AL report that is working with the Production Order table and Prod. Order Comment Line table. I have linked these 2 tables together by Prod. Order No. For any production order a comment does not exist the excel report outputs a NULL value. I understand why it would output a NULL value but I want to replace the value with blank or another value. I have tried the following methods to remove NULL:

1.  Within Dataitem(/Prod. Order Comment Line/; /Prod. Order Comment Line/) I have added
Trigger OnAfterGetRecord()
Begin
       if Comment = '' then
             Comment := ''
end;
I have changed that around a lot adding a space in Comment := ' ' or I tried if Comment = 'NULL'. This method did not seem to work
 
2. I then tried Conditional Formatting on the layout file but when you download the report from BC and look at the formatting, it shows No Condition Set.
 Layout File
 
After Download
 
Any help would be appreciated. If it changes anything, we are on the cloud version of BC. Here is my report code:
report 51001 /Work Center Report/{    ApplicationArea = All;    Caption = 'Work Center Report';    UsageCategory = ReportsAndAnalysis;    DefaultLayout = Excel;    ExcelLayout = './Layout/WorkCenterReport.xlsx';    //RDLCLayout = './Layout/WorkCenterReport.RDLC';    UseRequestPage = true;    dataset    {        dataitem(/Production Order/; /Production Order/)        {            DataItemTableView = sorting(/Due Date/, Status) where(Status = const(Released));            column(Prod_Order; /No./)            {            }            column(Item_No; /Source No./)            {            }            column(Description; Description)            {            }            column(Qty; Quantity)            {            }            column(Due_Date; /Due Date/)            {            }            column(Work_Center_No; /Work Center No/)            {            }            dataitem(/Prod. Order Comment Line/; /Prod. Order Comment Line/)            {                DataItemLink = /Prod. Order No./ = field(/No./);                column(Comment; Comment)                {                }                trigger OnAfterGetRecord()                begin                    if Comment = '' then                        Comment := ' ' // Set comment to empty if the record is empty                end;            }        }    }    trigger OnPreReport()    begin        Codeunit.Run(51003); // Run the /Status Logic/ codeunit    end;}
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at
    As far as I know this is standard behavior. For example, the following standard report,
     
    But you can create a column on the Excel layout to show empty when the value is null, I think this would solve the problem.
     
    Hope this helps.
    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

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,059 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 994 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans