Monday, May 4, 2020

Creating RDLC Report in Microsoft Dynamics 365 Business Central using Microsoft SQL Report Builder

Hi Readers,
Welcome back!
In this blog, we'll see how to create an RDLC Report in Business Central using AL and SQL Report Builder. 

When we talk about NAV, we already have an Object Designer wherein we create a new report, add datasets and create a Design in SQL Builder.
But Visual Studio does not have an Object Designer as shown below:


So do we have to write code even the design in AL?! Well, luckily no.
We are going to use the same SQL builder to Design our reports but how do we handle the Dataset and Object Designer controls? Here is the answer.
Following are the steps to follow:
1. Create a new report as shown below:

report 50001 OnHandQuantityList
{
    DefaultLayout = RDLC;
    RDLCLayout = 'OnHandQuantityList.rdl';


}

Note: Does the same work as Report Object Designer in NAV.

2. Build this extension (Ctrl+Shift+B) to generate a OnHandQuantityList.rdl file

3. Add Dataset to the report. 

report 50001 OnHandQuantityList
{
    DefaultLayout = RDLC;
    RDLCLayout = 'OnHandQuantityList.rdl';

    dataset
    {
        dataitem(Item; Item)
        {
            column(Inventory; Inventory)
            {
            }
        }
    }  

}

4. Build your extension again. 

5. Open the generated report in SQL Report Builder. So basically, we do not use an Objet Designer to open the Layout but a file which we will Design. 

6. Design the Layout like you will normally do. The code behind the report will be written in AL (report 50001)

7. Once you are done, compile and run (Ctrl+F5) your report. 

Easy right? A piece of advice, whenever are moving from NAV to Business Central do not take it as a new thing altogether. Always correlate Business Central with NAV, although the language is different, there will not be much difference in the process. The way of doing things will be different, leading you to the same step at some point. 


I hope this blog was helpful and easy to understand. Write your suggestions in the comment section.
Make sure you follow!

You can also email me at: jyotsnaoberainav@gmail.com

Also visit my website JONAV if you need help with any NAV/BC Services!


Thank you! 


No comments:

Post a Comment