Skip to main content

MSDYN365BC - AL Development 09 - How to Develop New Report in AL?

Hi Readers,

I hope you all are following this series and followed and completed what we have discussed till now.

If you are new to this then Please Refer Table of Index.

Last but not least in this article we will discuss how to develop a Report in AL.

A customer would like to analyze Source of Sales based on Item Sold.


** As of now there is no provision to customize Base NAV Reports. If I am not wrong this is something on the roadmap.

Let's try to add this Report to our extension.

Add a New file Inside New Folder Report on Left-hand Panel - right click & select New File as shown below.

As per our standard page file name is - SDH_Report_50000_Sourceofsales.al


Snippet for adding a new Report, use snippet treport as shown below.



Next Step to set these Report Properties - 
  • Assign ID and Provide a name of the Report that you are adding.
  • Set UsageCategory to ReportsAndAnalysis.
  • Set ApplicationArea to All.

Let's try to understand the skeleton -

  • Dataset.
    • DataItem. -- Tables
    • Column.   -- Table Fields/Variables. 
  • Request Page.
    • Fields.
    • Action.
  • Global Variables.


    I will remove some parts of the default skeleton, that is not required for this report.
    Our Report Dataset is based on the Data Item Item Ledger Entry Table(as shown below).


    Now, let's add columns or fields Required for Report (as shown below).


    As we all (NAV Experts) know that a report is a combination of two parts -
    • Dataset.
    • Layout.
    We have completed our dataset development. Let's see how to add Layout to this report. In the Report Property Section, we need to specify the value for two properties (as shown below).

    1. DefaultLayout - RDLC & Word.
    2. RDLCLayout and/or WordLayout - File Name with Extension .rdl and .docx (Remember file name is between '')


    Now the next step that we have to do is Build the extension (Ctrl+Shift+B) to generate the Layout File as shown below.


    To Build Layout, Right Click and Select Open Externally which will open the layout file in SQL Server Report Builder as below.



    Now Design the Layout as you did till now for a NAV Report. My Design Look like below.


    Once done close the layout and it will save the layout.

    If you are ready to see how the report looks like from client, Just click F5 and Publish the Extension to Apply changes to Business Central Tenant / Database.

    Using Tell me feature search for Source of Sales and select Report, specify filter if required and run Report.


    The output will be something like below.


    Hope you learned something new today.

    We will have a summary article after this post, with that we will end this series.

    Stay Tuned for more and please add comments if any questions/suggestions.

    Regards,
    Saurav Dhyani
    www.sauravdhyani.com

    Comments

    1. I have a little issue with RDLCLayout property part. DO I create the report file first before linking it or how do i go about it?

      Thanks

      ReplyDelete
      Replies
      1. No,
        As listed in article above you just assign those parameters and then Build the extension (Ctrl+Shift+B) to generate the Layout File.

        Delete

    Post a Comment

    Popular posts from this blog

    BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

    Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

    Send Mail with Attachment From Navision.

    Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

    MSDYN365BC - Data Upgrade To Microsoft Dynamics 365 Business Central on premises.

    Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let's discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions - 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.