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

problem in BC RDLC report dataitem link to multilple tables

(0) ShareShare
ReportReport
Posted on by

Hello everyone.

I am creating and designing RDLC Report in MS Report Builder. Basically I am designing a report on Posted Sales Invoice Document. I added link of "Sales Invoice Header" table with "Salesperson/Purchaser", "Sales Invoice Lines", "Payment Terms", "Shipment Method", "Payment Method" Tables but the report is showing data of first linking table that is ""Salesperson/Purchaser" but not showing data of other tables in the report.

I have defined report object and added data item links in VS Code as follows:

report 50108 "PS Invoice RDLC"
{
    DefaultLayout = RDLC;
    RDLCLayout = 'PSInvoice.rdl';
    UsageCategory = Administration;

    dataset
    {
        dataitem("Sales Invoice Header"; "Sales Invoice Header")
        {
            DataItemTableView = sorting("No.");
            // RequestFilterFields = "Pre-Assigned No.", "Order No.";
 
            column(PSInvoiceNo; "No.")
            {

            }
            column(Order_No_; "Order No."{ }
            column(Order_Date; "Order Date")
            {
            }
            column(Posting_Date; "Posting Date")
            {
            }
            column(Due_Date; "Due Date"{ }
            column(Document_Date; "Document Date"{ }
            column(CustomerName; "Bill-to Name"{ }
            column(ContactName; "Bill-to Contact"{ }
            column(STCustomer_No_; "Sell-to Customer No."{ }
            column(BTAddress; "Bill-to Address"{ }
            column(BTPostCode; "Bill-to Post Code"{ }
            column(BTCounty; "Bill-to County"{ }
            column(BTCountry; "Bill-to Country/Region Code"{ }
            column(ShippingAgentCode; "Shipping Agent Code"{ }
            column(STAddress; "Ship-to Address"{ }
            column(STCity; "Ship-to City"{ }
            column(STCountry; "Ship-to Country/Region Code"{ }
            column(STCounty; "Ship-to County"{ }
            COLUMN(STName; "Ship-to Name"{ }
            column(STode; "Ship-to Code"{ }
            column(STContact; "Ship-to Contact"{ }
            column(PTN; "Package Tracking No."{ }
            column(AmountExVAT; Amount{ }
            column(AmountIncVAT; "Amount Including VAT"{ }
            column(STPhoneNo; "Sell-to Phone No."{ }
            column(STEMail; "Sell-to E-Mail"{ }   
            dataitem("Salesperson/Purchaser"; "Salesperson/Purchaser")
            {
                DataItemLink = Code = field("Salesperson Code");
                column(Name; Name{ }
            }
            dataitem("Payment Terms"; "Payment Terms")
            {
                DataItemLink = Code = field("Payment Terms Code");

                column(PTDescription; Description{ }

            }

            dataitem("Shipment Method"; "Shipment Method")
            {

                DataItemLink = Code = field("Shipment Method Code");

                column(ShipmentDescription; Description{ }
            }
            dataitem("Payment Method"; "Payment Method")
            {

                DataItemLink = Code = field("Payment Method Code");
                column(PMDescription; Description{ }
            }

            dataitem("Sales Invoice Line"; "Sales Invoice Line")
            {
                DataItemLink = "Document No." = field("No.");
                // PrintOnlyIfDetail = true;
                column(ItemNo; "No."{ }
                column(Description; Description{ }
                column(Shipment_Date; "Shipment Date"{ }
                column(Quantity; Quantity{ }
                column(Unit_of_Measure; "Unit of Measure"{ }
                column(Unit_Price; "Unit Price"{ }
                column(Line_Amount; "Line Amount"{ }
            }

        }

    }
}

  pastedimage1589268330015v1.png

above is the screen shot of report displaying data. In highlighted parts, no data populated in he report but Salesperson field has data because it is first dataitem link in report object. But also note that Sales Invoice Lines data is also shown in the report. 

Can anybody please guide me in this.

  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  Nishat- We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

  • Suggested answer
    Genie Cetas Profile Picture
    472 on at

    Hi Nishat Bano,

    Please find the below coding for printing Sales/Purchase Person , Payment Terms, Shipment Method Description and Payment Method Description. i may use same as of your coding but i may made some changes in you coding that am highlighted here. am used record variable of payment terms, payment method, shipment method instead of using dataitem and i capture each one values in a Global variable and those values am printing in the report.

    Coding

    --------------------

    report 50108 "PS Invoice RDLC"
    {
        DefaultLayout = RDLC;
        RDLCLayout = 'PSInvoice.rdl';
        UsageCategory = Administration;

        dataset
        {
            dataitem("Sales Invoice Header"; "Sales Invoice Header")
            {
                column(PSInvoiceNo; "No."{  }
                column(Order_No_; "Order No."{ }
                column(Order_Date; "Order Date"{  }
                column(Posting_Date; "Posting Date"{  }
                column(Due_Date; "Due Date"{ }
                column(Document_Date; "Document Date"{ }
                column(CustomerName; "Bill-to Name"{ }
                column(ContactName; "Bill-to Contact"{}
                column(STCustomer_No_; "Sell-to Customer No."{ }
                column(BTAddress; "Bill-to Address"{ }
                column(BTPostCode; "Bill-to Post Code"{  }
                column(BTCounty; "Bill-to County"{  }
                column(BTCountry; "Bill-to Country/Region Code"{  }
                column(ShippingAgentCode; "Shipping Agent Code"{  }
                column(STAddress; "Ship-to Address"{ }
                column(STCity; "Ship-to City"{  }
                column(STCountry; "Ship-to Country/Region Code"{  }
                column(STCounty; "Ship-to County"{  }
                COLUMN(STName; "Ship-to Name"{  }
                column(STode; "Ship-to Code"{  }
                column(STContact; "Ship-to Contact"{  }
                column(PTN; "Package Tracking No."{  }
                column(AmountExVAT; Amount{  }
                column(AmountIncVAT; "Amount Including VAT"{ }
                column(STPhoneNo; "Sell-to Phone No."{}
                column(STEMail; "Sell-to E-Mail"{  }
                column(SalesPersonName;SalesPersonName){}
                column(PaymentTermDescription;PaymentTermDescription){}
                column(ShipmentDescription;ShipmentDescription){}
                column(PMDescription;PMDescription){}
                dataitem("Sales Invoice Line"; "Sales Invoice Line")
                {
                    DataItemTableView = sorting();
                    DataItemLink = "Document No." = field("No.");
                    column(ItemNo; "No."{  }
                    column(Description; Description{  }
                    column(Shipment_Date; "Shipment Date"{  }
                    column(Quantity; Quantity{  }
                    column(Unit_of_Measure; "Unit of Measure"{  }
                    column(Unit_Price; "Unit Price"{  }
                    column(Line_Amount; "Line Amount"{  }
                }
                trigger OnAfterGetRecord()
                var
                    //myInt: Integer;
                begin
                    SalespersonPurchaser.Reset();
                    SalespersonPurchaser.SetRange(Code,"Salesperson Code");
                    if SalespersonPurchaser.FindFirst() then
                       SalesPersonName := SalespersonPurchaser.Name;
                    PaymentTerms.Reset();
                    PaymentTerms.SetRange(Code,"Payment Terms Code");
                    if PaymentTerms.FindFirst() then
                       PaymentTermDescription := PaymentTerms.Description;
                    ShipmentMethod.Reset();
                    ShipmentMethod.SetRange(Code,"Shipment Method Code");
                    if ShipmentMethod.FindFirst() then
                      ShipmentDescription := ShipmentMethod.Description;
                    PyamentMethod.Reset();
                    PyamentMethod.SetRange(Code,"Payment Method Code");
                    if PyamentMethod.FindFirst() then
                       PMDescription := PyamentMethod.Description;
                end;
            }
        }
        var
        SalespersonPurchaser: Record "Salesperson/Purchaser";
        PaymentTerms: Record "Payment Terms";
        ShipmentMethod: Record "Shipment Method";
        PyamentMethod: Record "Payment Method";
        SalesPersonName: Text[250];
        PaymentTermDescription: Text[250];
        ShipmentDescription: Text[205];
        PMDescription: Text[250];
    }

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

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 757 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 451 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 391 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans