29 Dec’17

D365 Business Central

Creation of Reports using AL Extension in Microsoft Dynamcis NAV Development Preview

Introduction:

This blog demonstrates the creation of Reports through extensions in Microsoft Dynamics NAV Development Preview Environment(Microsoft Dynamics 365 for Financials and Operation, Business Edition).

Pre-requisite:

  • Microsoft Dynamics NAV Development Preview Environment
  • Visual Studio Code with AL Extensions

Demonstration:

1. Creating a  Report using AL extensions.

report 50100 MyReport
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    CaptionML = ENU = 'MyCustomerList';
    RDLCLayout = 'ReportLayouts/MyReport.rdl';
   // WordLayout='ReportLayouts/MyReportWord.docx';
    // DefaultLayout=Word;
    dataset
    {
        dataitem(DataItemName; Customer)
        {
            column(CustomerName; Name)
            {
            }
            column(CustomerNumber; "No.")
            {
            }
        }
    }
    requestpage
    {
        layout
        {
            area(content)
            {
                group(GroupName)
                {
                    field(HideDetails; HideDetails)
                    {
                    }
                }
            }
        }
        actions
        {
            area(processing)
            {
                action(ActionName)
                {
                }
            }
        }
    }
    var
        HideDetails: Boolean;
}

2. Creating a Page Action to run the Report using AL extensions.

pageextension 50100 MyExtension extends "Customer List"
{
layout{
}
actions
{
// Add changes to page actions here
addlast("&Customer")
{
action(ShowMyReport)
{
ApplicationArea = All;
trigger OnAction();
begin
clear(myReport);
myReport.Run;
end;
}
}
}
var
MyReport : Report MyReport;
}

3. Installing the extension and executing the Report, the results are blank as the Layout for the Report is not set.

4. To create the layout, search for ‘Report Layout Selection’.

5. Then select the report added through the extensions and Export the template.

6. Open the RDL Export file in SSRS or Visual Studio and add the relevant fields or tables.

7. In the Visual Studio Code add the following lines of code.

RDLCLayout=<PATH of RDL File>;

UsageCategory = ReportsAndAnalysis;

ApplicationArea = All;

8. Viewing the Report

Conclusion:

Thus according to the NAV 2018, the report when created in C/SIDE automatically has an RDL file associated with it. But when creating reports through extensions separately the layout needs to be created.
 

Written by

Olister Rumao

Software Engineer

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Integrate Dynamics 365 for Customer Engagement Apps with Microsoft Teams

    18 June’ 2019

    Before getting into details, firstly I would like to talk about Microsoft Teams. If you’re familiar with MS Teams, you...

    Read more
  • Applying Default / Mandatory Dimension in NAV / Business Central

    17 June’ 2019

    Introduction: In this blog, I aim to provide how to set Mandatory Dimensions on Items, Customers, Vendors, and G/L Accou...

    Read more
  • Automatically adding dimensions from Shortcut Dimension from Excel Import in Microsoft Dynamics NAV / Business Central

    17 June’ 2019

    Problem Statement: I have a requirement where the contents of the General Journals are to export to Excel and also can c...

    Read more
  • Using “startswith” Filter Query in MS Flow

    12 June’ 2019

    Introduction This blog explains how to use “startswith” filter query in MS Flow. Use Case Using MS Flows to retrieve...

    Read more
  • Print pro-forma invoice in Dynamics 365 Finance and Operations

    11 June’ 2019

    In this article I am going to demonstrate how to view/print  pro-forma invoice. A pro forma invoice is an invoice that ...

    Read more
  • We respect your privacy.
  • This field is for validation purposes and should be left unchanged.