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

    VIEW SERVER STATE permission on SQL Server?

    Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

    RTC Report It is not possible to instantiate the Visual Studio bridge.

    Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searching for the error i figured out the issue was due to - Design change in NA

    NAV 2013 R2 - Cumulative update 12 Released.

    Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.