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

Excel report layout in business central via AL code

(4) ShareShare
ReportReport
Posted on by 17
Hello everyone,
I am trying to create this layout in excel via AL code, But all columns are coming on one row only.

help me with this one pls.
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,554 Super User 2026 Season 1 on at
    Hi there! Good morning, evening, or afternoon - depending on where you are :) Hope you are well today! 
     
    To create an Excel report layout in Business Central via AL code and ensure the columns are displayed correctly, follow these steps:

    1: Define the Report Dataset
    • In your AL project, create a new report object or modify an existing one.
    • Define the data items and columns that will be included in the report. Ensure the dataset structure matches the desired layout.
    report 50100 "Excel Report Example"
    {
        DataItem(Item; Item)
        {
            Column(ItemNo; Item."No.")
            {
            }
            Column(Description; Item.Description)
            {
            }
            Column(SalesAmount; Item."Sales (LCY)")
            {
            }
        }
    }

    2: Create the Excel Layout
    • Run the report in Business Central and export it as an Excel file (data only).
    • Open the exported Excel file and design the layout:
      • Use separate rows for headers and data.
      • Add any formatting, formulas, or additional columns as needed.
    • Save the Excel file.
    3: Add the Excel Layout to the Report
    1. In the AL project, upload the Excel layout to the report object:
      • Use the ExcelLayout property to specify the layout file.

    report 50100 "Excel Report Example"
    {
        ExcelLayout = 'MyExcelLayout.xlsx';
    }
    1. Ensure the layout file is included in your AL project folder.
    4: Test the Report
    1. Publish the extension to your Business Central environment.
    2. Run the report and verify that the layout displays correctly in Excel.
    Troubleshooting
    • If all columns appear in one row, ensure that the Data worksheet in the Excel layout has the correct structure. Each column header should be in a separate cell in the first row.
    • Check that the dataset fields in the AL code match the metadata fields in the Excel layout.
     
    hope this helps some! 
  • Suggested answer
    YUN ZHU Profile Picture
    99,324 Super User 2026 Season 1 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,206 Super User 2026 Season 1 on at

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 March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,823 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,011 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 628 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans