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

ReportExtension Multiple DataItem Issue

(0) ShareShare
ReportReport
Posted on by 15

I am trying to add two DataItems to the existing Assembly Order report in order to show details from the Lot Numbers assigned to both the header (resulting item) and the consumed BOM line items.

reportextension 50050 "Assembly Order Report Ext" extends "Assembly Order"
{
    RDLCLayout = './AssemblyOrder.rdl';

    dataset
    {
        addlast("Assembly Line")
        {
            dataitem(WOHeaderLotNo; "Reservation Entry")
            {
                DataItemLinkReference = "Assembly Header";
                DataItemLink = "Source ID" = field("No.");
                DataItemTableView = where("Source Type" = const(900));
                column(LotNo_AssemblyHeader; "Lot No.") { }
                column(LotQty_AssemblyHeader; "Quantity") { }

                dataitem(WOLineLotNo; "Reservation Entry")
                {
                    DataItemLinkReference = "Assembly Line";
                    DataItemLink = "Source ID" = field("Document No."), "Source Ref. No." = field("Line No.");
                    DataItemTableView = where("Source Type" = const(901));
                    column(LotNo_AssemblyLine; "Lot No.") { }
                    column(LotQty_AssemblyLine; "Quantity") { }
                }
            }
        }
    }
}

When I do it this way with the line item detail DataItem underneath the Header DataItem in the hierarchy, the line item lot details only populate when the header has a Lot number assigned, which isn't ideal. But if I move the line item detail dataitem to be at the same level as the header dataitem (which seems like the right way to do it), then I get a strange unlinked data set - there is a set of rows with the line item detail lot number columns populated but the header lot columns all null, and there is a set of rows with the header lot columns populated but the detail lot columns all null. I would expect there to be a single set of rows that has both the header lot and detail lot columns populated.

Can someone help me set this up properly? Thank you!

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Please give a try of below code.

    reportextension 50050 "Assembly Order Report Ext" extends "Assembly Order"

    {

       RDLCLayout = './AssemblyOrder.rdl';

       dataset

       {

           addbefore("Assembly Line")

           {

               dataitem(WOHeaderLotNo; "Reservation Entry")

               {

                   DataItemLinkReference = "Assembly Header";

                   DataItemLink = "Source ID" = field("No.");

                   DataItemTableView = where("Source Type" = const(900));

                   column(LotNo_AssemblyHeader; "Lot No.") { }

                   column(LotQty_AssemblyHeader; "Quantity") { }

               }

           }

           addlast("Assembly Line")

           {

               dataitem(WOLineLotNo; "Reservation Entry")

               {

                   DataItemLinkReference = "Assembly Line";

                   DataItemLink = "Source ID" = field("Document No."), "Source Ref. No." = field("Line No.");

                   DataItemTableView = where("Source Type" = const(901));

                   column(LotNo_AssemblyLine; "Lot No.") { }

                   column(LotQty_AssemblyLine; "Quantity") { }

               }

           }

       }

    }

  • JaredMiller Profile Picture
    15 on at

    Hi, Nitin. Thanks for the suggestion. Unfortunately, this gives me the same issue I described... I get several records with the *_AssemblyHeader columns populated and null for the *_AssemblyLine colums, and then I get the rest of the rows with the *_AssemblyLine columns populated and the *_AssemblyHeader columns null. Any other recommendations?

    Thanks!

    -- Jared

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 674 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 362 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 359 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans