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;}