web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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,530 Super User 2025 Season 2 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
    95,599 Super User 2025 Season 2 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,439 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans