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

Modifying order of columns in excel report

(0) ShareShare
ReportReport
Posted on by 130

Hi All, 

My AL code is below. I would like to order report so that 1st 5 columns are: No. / Description / Location_Code / Bin_Code / Quantity_Base

However, since this information is in 2 separate tables, using datalink, it seems like it restricts my ability to format order of columns. So I must request all columns from Table 1....then Table 2, and can not configure the order of columns from 2 separate tables.

Is this correct?

report 60002 customInventoryValuation
{
    ApplicationArea = All;
    Caption = 'Inventory Report';
    ExcelLayout = 'customInventoryReportValuation.xlsx';
    DefaultLayout = Excel;
    UsageCategory = ReportsAndAnalysis;
    dataset
    {
        dataitem(Item; Item)
        {
            column(No_; "No.")
            {
                IncludeCaption = true;
            }
            column(Vendor_Item_No_; "Vendor Item No.")
            {
                IncludeCaption = true;
            }
            column(Description; Description)
            {
                IncludeCaption = true;
            }
            column(Base_Unit_of_Measure; "Base Unit of Measure")
            {
                IncludeCaption = true;
            }

            dataitem("BinContent"; "Bin Content")
            {
                DataItemLink = "Item No." = field("No.");

                column(Location_Code; "Location Code")
                {
                    IncludeCaption = true;
                }
                column(Bin_Code; "Bin Code")
                {
                    IncludeCaption = true;
                }
                column(Quantity__Base_; "Quantity (Base)")
                {
                    IncludeCaption = true;
                    DecimalPlaces = 0;
                }
                column(Inventory_Value; "Inventory Value")
                {
                    IncludeCaption = true;

                }
                trigger OnPreDataItem()
                var
                begin
                    SetFilter("Quantity (Base)", '>%1', 0);
                    SetFilter(Quantity, '>%1', 0);
                end;

                trigger OnAfterGetRecord()
                var
                    itemRecord: Record item;
                begin
                    "Inventory Value" := item."Standard Cost" * "Quantity (Base)";
                end;

            }
            trigger OnPreDataItem()
            var
                binContentRecord: Record "Bin Content";
            begin
                SetFilter(Type, '%1', type::Inventory);
                SetFilter("No.", '<>%1', '');
                SetFilter(Inventory, '<>%1', 0);
            end;
        }
    }
    requestpage
    {
        SaveValues = true;
        layout
        {

            area(content)
            {
                group(GroupName)
                {
                }
            }
        }
        actions
        {

            area(processing)
            {

            }
        }
    }

}

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,026 Super User 2026 Season 1 on at

    Hi, sorry I may not fully understand your question, if you want to set DataItem sorting, you can use DataItemTableView Property.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-dataitemtableview-property

    In addition, if you use Excel Layout, I think you can create another sheet and customize the sorting.

    Hope this helps.

    Thanks.

    ZHU

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,091 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,032 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 946 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans