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 -
Let's try to understand the skeleton -
Dataset.
Request Page.
Global Variables.
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 -
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
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.
- DataItem. -- Tables
- Column. -- Table Fields/Variables.
- Fields.
- Action.
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.
- DefaultLayout - RDLC & Word.
- 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
Thank You. ♫♫
ReplyDeleteGreat to hear you liked the article @Tabura.
DeleteI 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?
ReplyDeleteThanks
No,
DeleteAs listed in article above you just assign those parameters and then Build the extension (Ctrl+Shift+B) to generate the Layout File.