29 Dec’17

Dynamics NAVCreation 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

Trainee Software Engineer

Leave a Reply

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

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

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

Recent Articles

  • Commands to Import .bacpac file to D3FOE SQL Server

    14 May’ 2018

    Introduction: This blog article will explain how to import a .bacpac file to Microsoft SQL Server which is created from ...

    Read more
  • [Solved] – Backspace not working in HTML Web Resources

    11 May’ 2018

    Issue: When we use a HTML web resource in Dynamics 365 CRM forms or even as a separate navigation, we sometimes face is...

    Read more
  • Dynamics 365 Tip: Sending Emails using Unified Interface

    10 May’ 2018

    Introduction: The unified client which was released D365 V9 had a very refreshing UI and lots of features. One of the b...

    Read more
  • Filtering Records on BPF unlike on Form – D365

    10 May’ 2018

    Introduction: Working with D365 is best when you’re trying to use as much OOB stuff as possible. Simplest configurati...

    Read more
  • Filter records in gallery control based on value selected in other gallery control in PowerApps.

    10 May’ 2018

    Introduction: This blog explains how to Filter records in gallery control based on value selected in other gallery cont...

    Read more