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";
}