Share This Post

Business Central Report Design Overview

Microsoft Dynamics 365 Business Central Report Design are used to print or display information from a database. You can utilize a report to structure and summarize information and to print documents, such as sales quotes and invoices.

Creating a report consists of two primary tasks the initial task is to generate the underlying data model and the following is to define the visual layout that displays the data. The report object describes the underlying data model and states which database tables and fields to pull data from.

When the report is executed, that data is displayed in a particularized layout the visual layout, which determines the content and format of a report when it is viewed and printed.

You build the layout of a report by organizing the data items and columns and specifying the general format, such as text font and size. Two types of report layouts are there, client report definition, also called as RDL layouts and Word layouts. RDL layouts are described in Visual Studio Report Designer or Microsoft SQL Server Reporting Services Report Builder.

Word layouts are created using Word. Word layouts are based on a Word document that includes a custom XML part representing the report dataset.

A report is composed of the following items:

  • A report object
  • A report dataset
  • A report layout
  • A request page
  • Properties, triggers and code

You design a report by first defining the dataset and then designing the visual layout.

Business Central Report Design Process

1. Report Layouts

The visual layout determines the content and format of a report when it is viewed and printed. You build the layout of a report by organizing data items and columns and specifying the general format, such as text font and size.

A Business Central Report Design that is viewed, printed or saved from a MS D365 Business Central client must have a report layout. There are two types of report layouts: layouts using report definition language (RDL) and Word layouts.

RDL Layout

To create an RDL layout report, you use Visual Studio Report Designer or Microsoft SQL Server Reporting Services Report Builder.

RDL layouts result in slower performance with document reports, pertaining actions that are related to the user interface compared to Word layouts. While developing layouts for the document reports, it is suggested that you design Word layouts instead of RDL.

With Word layouts, reports are not influenced by the security constraints on sandbox app domains like how they are with RDL layouts. From a service perspective, RDL layouts are not trusted, so they will run in a sandbox appdomain that only lives for the current report invocation.

Word Report Layout

You create Word layouts by using a Word Document. Word layouts are based on a Word document that includes a custom XML parts that represents the report dataset.

2. Report Object

You create a report object in the AL Language development environment to define the data model, or dataset of a report. You can structure and summarize information in a report and print documents, such as sales quotes and invoices.

Report Dataset

In order to define the underlying data model, you use the report dataset. A report data set decides the data that is extracted or calculated from the MS Dynamics 365 Business Central database tables that can be used in a report. You build the report data set by inserting data items and columns.

Snippet Support

Typing the shortcut treport will create the basic layout for a report object when using the AL Language extension in Visual Studio Code.

Report Example

The following example is a report that prints the list of customers. The Business Central Report Design object describes a data set of columns from the Customer table.

report 50103 “Customer List”
{
CaptionML=ENU=’Customer List’;
RDLCLayout = ‘Customer List Report.rdlc’; // if the Word use WordLayout property
dataset
{
dataitem(Customer;Customer)
{
RequestFilterFields=”No.”,”Search Name”,”Customer Posting Group”;
column(COMPANYNAME;COMPANYNAME)
{
}
column(CurrReport_PAGENO;Customer.”no.”)
{
}
column(Customer_TABLECAPTION_CustFilter;TABLECAPTION + ‘: ‘ + CustFilter)
{
}
column(CustFilter;CustFilter)
{
}
column(Customer_No;”No.”)
{
}
column(Customer_Customer_Posting_Group;”Customer Posting Group”)
{
}
column(Customer_Customer_Disc_Group;”Customer Disc. Group”)
{
}
column(Customer_Invoice_Disc_Code;”Invoice Disc. Code”)
{
}
column(Customer_Customer_Price_Group;”Customer Price Group”)
{
}
column(Customer_Fin_Charge_Terms_Code;”Fin. Charge Terms Code”)
{
}
column(Customer_Payment_Terms_Code;”Payment Terms Code”)
{
}
column(Customer_Salesperson_Code;”Salesperson Code”)
{
}
column(Customer_Currency_Code;”Currency Code”)
{
}
column(Customer_Credit_Limit_LCY;”Credit Limit (LCY)”)
{
DecimalPlaces=0:0;
}
column(Customer_Balance_LCY;”Balance (LCY)”)
{
}
column(CustAddr_1;CustAddr[1])
{
}
column(CustAddr_2;CustAddr[2])
{
}
column(CustAddr_3;CustAddr[3])
{
}
column(CustAddr_4;CustAddr[4])
{
}
column(CustAddr_5;CustAddr[5])
{
}
column(Customer_Contact;Contact)
{
}
column(Customer_Phone_No;”Phone No.”)
{
}
column(CustAddr_6;CustAddr[6])
{
}
column(CustAddr_7;CustAddr[7])
{
}
column(Customer_ListCaption;Customer_ListCaptionLbl)
{
}
column(CurrReport_PAGENOCaption;CurrReport_PAGENOCaptionLbl)
{
}
column(Customer_NoCaption;FIELDCAPTION(“No.”))
{
}
column(Customer_Customer_Posting_GroupCaption;Customer_Customer_Posting_GroupCaptionLbl)
{
}
column(Customer_Customer_Disc_GroupCaption;Customer_Customer_Disc_GroupCaptionLbl)
{
}
column(Customer_Invoice_Disc_CodeCaption;Customer_Invoice_Disc_CodeCaptionLbl)
{
}
column(Customer_Customer_Price_GroupCaption;Customer_Customer_Price_GroupCaptionLbl)
{
}
column(Customer_Fin_Charge_Terms_CodeCaption;FIELDCAPTION(“Fin. Charge Terms Code”))
{
}
column(Customer_Payment_Terms_CodeCaption;Customer_Payment_Terms_CodeCaptionLbl)
{
}
column(Customer_Salesperson_CodeCaption;FIELDCAPTION(“Salesperson Code”))
{
}
column(Customer_Currency_CodeCaption;Customer_Currency_CodeCaptionLbl)
{
}
column(Customer_Credit_Limit_LCYCaption;FIELDCAPTION(“Credit Limit (LCY)”))
{
}
column(Customer_Balance_LCYCaption;FIELDCAPTION(“Balance (LCY)”))
{
}
column(Customer_ContactCaption;FIELDCAPTION(Contact))
{
}
column(Customer_Phone_NoCaption;FIELDCAPTION(“Phone No.”))
{
}
column(Total_LCY_Caption;Total_LCY_CaptionLbl)
{
}

trigger OnAfterGetRecord();
begin
CALCFIELDS(“Balance (LCY)”);
FormatAddr.FormatAddr(
CustAddr,Name,”Name 2″,”,Address,”Address 2″,
City,”Post Code”,County,”Country/Region Code”);
end;

}
}

requestpage
{
SaveValues=true;
ContextSensitiveHelpPage = ‘my-feature’;
layout
{
}

actions
{
}
}

labels
{
LabelName = ‘Label Text’, Comment = ‘Foo’, MaxLength = 999, Locked = true;
}

trigger OnPreReport();
var
CaptionManagement : Codeunit 42;
begin
CustFilter := CaptionManagement.GetRecordFiltersWithCaptions(Customer);
end;

var
FormatAddr : Codeunit 365;
CustFilter : Text;
CustAddr : ARRAY [8] OF Text[50];
Customer_ListCaptionLbl : TextConst ENU=’Customer – List’;
CurrReport_PAGENOCaptionLbl : TextConst ENU=’Page’;
Customer_Customer_Posting_GroupCaptionLbl : TextConst ENU=’Customer Posting Group’;
Customer_Customer_Disc_GroupCaptionLbl : TextConst ENU=’Cust./Item Disc. Gr.’;
Customer_Invoice_Disc_CodeCaptionLbl : TextConst ENU=’Invoice Disc. Code’;
Customer_Customer_Price_GroupCaptionLbl : TextConst ENU=’Price Group Code’;
Customer_Payment_Terms_CodeCaptionLbl : TextConst ENU=’Payment Terms Code’;
Customer_Currency_CodeCaptionLbl : TextConst ENU=’Currency Code’;
Total_LCY_CaptionLbl : TextConst ENU=’Total (LCY)’;
}

For more information on Microsoft Dynamics 365 Business Central Report Design Overview, please contact us.

Share This Post

Leave a Reply

avatar
  Subscribe  
Notify of
Skip to toolbar