Skip to main content

Notifications

Announcements

No record found.

Business Central forum

Report Data Item in Extension 2.0

(0) ShareShare
ReportReport
Posted on by 768

i am working on extension 2.0

i am facing with error while reporting i have 2 data item now facing that how to link this data item 
DataItemTableView  Property ?

DataItemLink Property ?

need this two property how to use it in extension 2.0 ?

Thanks 

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,081 Super User 2024 Season 1 on at
    RE: Report Data Item in Extension 2.0

    report 50121 NewPSalesInvoiceReport
    {
    Caption = 'Sales Invoice Report';
    ApplicationArea = all;
    DefaultLayout = RDLC;
    UsageCategory = ReportsAndAnalysis;
    RDLCLayout = 'NewPSalesInvoiceReport.rdl';
    dataset
    {
    dataitem("Sales Invoice Header";"Sales Invoice Header")
    {
    DataItemTableView = sorting("No.");
    RequestFilterFields = "Sell-to Customer No.","No.","Posting Date";
    PrintOnlyIfDetail = true;

    column(CompNme;CompanyInformation.Name)
    {}
    column(CompName2;CompanyInformation."Name 2")
    {}
    Column(SelltoCustomerNo_SalesHeader;"Sales Invoice Header"."Sell-to Customer No."){}
    trigger OnAfterGetRecord()
    begin
    CountryName := '';
    IF CountryRegion.GET("Sales Invoice Header"."Sell-to Country/Region Code") THEN
    CountryName := CountryRegion.Name;

    end;
    }


    dataitem("Sales Invoice Line";"Sales Invoice Line")
    {
    DataItemTableView = SORTING("Document No.","Line No.");
    DataItemLinkReference = "Sales Invoice Header";
    PrintOnlyIfDetail= false;
    Column(Amount_SalesLine;"Sales Invoice Line".Amount){}

    trigger OnPreDataItem()
    begin
    SetRange("Document No.","Sales Invoice Header"."No.");
    end;
    }
    }

    trigger OnPreReport()
    begin
    CompanyInformation.GET;
    CompanyInformation.CALCFIELDS(Picture);
    IF CountryRegion.GET(CompanyInformation."Country/Region Code") THEN;
    end;

    var
    CompanyInformation:Record "Company Information";
    CountryRegion:Record "Country/Region";
    CountryName:Text;
    CustLedgerEntry:Record "Cust. Ledger Entry";

    }

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Report Data Item in Extension 2.0

    You can use DataItemLink like the following:

    dataitem("Sales Header"; "Sales Header")

       {

           column("No"; "No.")

           {

           }

           dataitem("Sales Line";"Sales Line")

           {

               DataItemLink = "Document Type"=FIELD("Document Type"),"Document No."=FIELD("No.");

               column(Type; Type)

               {

               }

           }

       }

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans