ExcelBuffer exports date wrong into Excel file.
If current region represents date in 'dd.mm.yy' format and it can be "Evaluated" into Time then BC writes in excel file cell date as Time + current date.
Date can be "Evaluated" to Time if:
dd = 1..23
mm = 1..12
yy = 1..60
if date = 01.01.26 then Time = 01:01:26
Bug in current Microsoft functional :
ExportCostBudgettoExcel.Report.al
Reproduce via current Microsoft functional:
- Current date 07.05.2026
- Choose Region Finnish(Finland) 1035
- Cost Budgets -> Cost Budget per Period (1117, ListPlus) -> Cost Budget per Period Matrix (1131, ListPart)
View by Day.
Actions -> Export To Excel
Actual result:
Expected result (if use region "Sami, Northern (Finland)"):
Reproduce via al code:
Current date = 07.05.2026
action("Export Excel 1")
{
ToolTip = 'Export Excel 1';
Image = Export;
ApplicationArea = All;
trigger OnAction()
var
TempExcelBuffer: Record "Excel Buffer" temporary;
TestDate: Date;
begin
TestDate := 20260101D;
TempExcelBuffer.Init();
TempExcelBuffer.Validate("Row No.", 1);
TempExcelBuffer.Validate("Column No.", 1);
TempExcelBuffer."Cell Value as Text" := Format(TestDate);
TempExcelBuffer."Cell Type" := TempExcelBuffer."Cell Type"::Date;
TempExcelBuffer.Insert();
TempExcelBuffer.CreateNewBook('Sheet1');
TempExcelBuffer.WriteSheet('Sheet1', CompanyName, UserId);
TempExcelBuffer.CloseBook();
TempExcelBuffer.SetFriendlyFilename('SimpleDateExport');
TempExcelBuffer.OpenExcel();
end;
}
action("Export Excel 2")
{
ToolTip = 'Export Excel 2';
Image = Export;
ApplicationArea = All;
trigger OnAction()
var
TempExcelBuffer: Record "Excel Buffer" temporary;
TestDate: Date;
begin
TestDate := 20260101D;
TempExcelBuffer.EnterCell(TempExcelBuffer, 1, 1, TestDate, false, false, false);
TempExcelBuffer.CreateNewBook('Sheet1');
TempExcelBuffer.WriteSheet('Sheet1', CompanyName, UserId);
TempExcelBuffer.CloseBook();
TempExcelBuffer.SetFriendlyFilename('SimpleDateExport');
TempExcelBuffer.OpenExcel();
end;
}
Results
Versions
Cloud Version: FI Business Central 27.5 (Platform 27.0.49565.0 + Application 27.5.46862.49825)
OnPrem Version: FI Business Central 27.3 (Platform 27.0.44301.0 + Application 27.3.44313.44331)
ExcelBuffer exports date wrong into Excel file.
If current region represents date in 'dd.mm.yy' format and it can be "Evaluated" into Time then BC writes in excel file cell date as Time + current date.
Date can be "Evaluated" to Time if:
dd = 1..23
mm = 1..12
yy = 1..60
if date = 01.01.26 then Time = 01:01:26
Bug in current Microsoft functional :
ExportCostBudgettoExcel.Report.al
Reproduce via current Microsoft functional:
View by Day.
Actions -> Export To Excel
Actual result:
Expected result (if use region "Sami, Northern (Finland)"):
Reproduce via al code:
Current date = 07.05.2026
Results
Versions
Cloud Version: FI Business Central 27.5 (Platform 27.0.49565.0 + Application 27.5.46862.49825)
OnPrem Version: FI Business Central 27.3 (Platform 27.0.44301.0 + Application 27.3.44313.44331)