Hi Readers,
Now its time to develop the most important part of Navision which client desire the most yes you are correct i am talking about Reports.
As we know to develop any solution in Business Central we must start working on AL Code Extension so from this blog you will get to know the detailed step how to create a Report through AL Code in business Central.
Note: As of now there is no provision to customise the base report.
Let’s try to create a simple report.
Add new file with .al extension in your project folder through visual studio code
My File Name is My_report.al
Code 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.
As you select the treport snippet then a default structure of the report is created as below:
Basically, there are 3 parts:
1. Dataset: where we select data items and corresponding fields
2. Request Page: The request page of the report where we can modify the request page.
2.1 Request page Action: we can say it is the sub part of request page.
2.2 Request Page fields
3. Global Variables
We can remove some part of the default report generated by the system which is not required.
My report is based upon the Data Item Customer Ledger Entry:
Now, add columns or fields Required for Report (as shown below)
As we all know NAV report development is combination of 2 parts:
1. Dataset Design
2. Layout Design
We have completed the Dataset development, Now to add layout in the report we need to set two properties of report:
1. DefaultLayout - RDLC & Word.
2. RDLCLayout and/or WordLayout - File Name with Extension .rdl and .docx (Remember file name is between '')
Now to build layout we must do Build the extension (Ctrl+Shift+B) to generate the Layout File as shown below.
Now create the layout by opening the .rdlc file externally with SQL Server Report Builder by right clicking on it as below:
It will show all the columns which you had selected in dataset design:
Here you can design your layout and after that save your layout and close the layout designer
After designing my layout is showing like below:
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.
After publishing the app now, you will be able to find the report in the search section of business central:
Below is the report request page:
Below is the output of the report:
Now its time to develop the most important part of Navision which client desire the most yes you are correct i am talking about Reports.
As we know to develop any solution in Business Central we must start working on AL Code Extension so from this blog you will get to know the detailed step how to create a Report through AL Code in business Central.
Note: As of now there is no provision to customise the base report.
Let’s try to create a simple report.
Add new file with .al extension in your project folder through visual studio code
My File Name is My_report.al
Code 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.
As you select the treport snippet then a default structure of the report is created as below:
Basically, there are 3 parts:
1. Dataset: where we select data items and corresponding fields
2. Request Page: The request page of the report where we can modify the request page.
2.1 Request page Action: we can say it is the sub part of request page.
2.2 Request Page fields
3. Global Variables
We can remove some part of the default report generated by the system which is not required.
My report is based upon the Data Item Customer Ledger Entry:
Now, add columns or fields Required for Report (as shown below)
As we all know NAV report development is combination of 2 parts:
1. Dataset Design
2. Layout Design
We have completed the Dataset development, Now to add layout in the report we need to set two properties of report:
1. DefaultLayout - RDLC & Word.
2. RDLCLayout and/or WordLayout - File Name with Extension .rdl and .docx (Remember file name is between '')
Now to build layout we must do Build the extension (Ctrl+Shift+B) to generate the Layout File as shown below.
Now create the layout by opening the .rdlc file externally with SQL Server Report Builder by right clicking on it as below:
It will show all the columns which you had selected in dataset design:
Here you can design your layout and after that save your layout and close the layout designer
After designing my layout is showing like below:
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.
After publishing the app now, you will be able to find the report in the search section of business central:
Below is the report request page:
Below is the output of the report:
Thanks,
Hope you find this article fruitful.
Let me know your thoughts in comment section.
Comments
Post a Comment