Bewerken

Delen via


ExcelLayoutMultipleDataSheets Property

Version: Available or changed with runtime version 12.0.

Sets whether an Excel layout will render to multiple data sheets or in a single sheet named Data.

Multiple sheets will be named Data_DataItemName, where DataItemName is the dataitem name used in the report design. There will be one sheet per root dataitem in the report object. The default is to use a single sheet for all data.

Applies to

  • Report
  • Report Layout

Remarks

Starting in 2025 release wave 1 (runtime 15), the ExcelLayoutMultipleDataSheets property is available on individual report layouts. It lets you override the global property defined on the report object. If the ExcelLayoutMultipleDataSheets property isn't used or is set to false on the report object, you can add Excel layouts that use the ExcelLayoutMultipleDataSheets feature without breaking existing layouts that users added. This cabability is useful for adding new Excel layouts to a report using the structure that ExcelLayoutMultipleDataSheets provides. Learn more in Creating an Excel layout report.

Example

This code demonstrates how to use the ExcelLayoutMultipleDataSheets property. Although the ExcelLayoutMultipleDataSheets property is false on the report object, the rendered report in Excel includes worksheets for DataItem1 and DataItem2 because the ExcelLayoutMultipleDataSheets property is true in the layout definition.

report 50100 MyReport
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    DefaultRenderingLayout = MyLayout;
    ExcelLayoutMultipleDataSheets = false;

    dataset
    {
        dataitem(DataItem1; Table1)
        {
            column(Column1; Column1)
            {

            }
        }
        dataitem(DataItem2; Table2)
        {
            column(Column2; Column2)
            {

            }
        }
    }

    rendering
    {
        layout(MyLayout1)
        {
            Type = Excel;
            LayoutFile = 'mySpreadsheet.xlsx';
            ExcelLayoutMultipleDataSheets = true;
        }
    }

}

Getting Started with AL
Developing Extensions