To create an SSRS report in Microsoft Dynamics 365 F&O, we need to follow the below steps,
Create a temporary table that will contain all the fields that needs to be shown on the SSRS report, in my case, I am creating CustReportTmp. Now set the property of the table as InMemory, so that the table will become temp table.
Now create an RDP class, The best practice for creating RDP class is to suffix DP at the end of the class name.
class CustReportDP extends SRSReportDataProviderBase
{
CustReportTmp custReportTmp;
[SRSReportDataSetAttribute(tablestr('CustReportTmp'))]
public custReportTmp getCustReportRDPDemoTmp()
{
select * from custReportTmp;
return custReportTmp;
}
public void processReport()
{
TTC_Customer customer;
while select * from customer
{
custReportTmp.clear();
custReportTmp.ID = customer.ID;
custReportTmp.Name = customer.Name;
custReportTmp.Age = customer.Age;
custReportTmp.Phone = customer.Phone;
custReportTmp.EmailID = customer.EmailID;
custReportTmp.Balance = customer.Balance;
custReportTmp.insert();
}
}
}
Now create a report, rename the report accordingly in this case “ReportRDP”, add dataset in the report, and name the dataset. put the data source type property to “Report data provider”, Now select the query that we created.
Now right-click on design and create a new design, go to properties, and give the name of the design and style template to “table style alternating rows”. Now edit design by clicking on “edit using designer”.
Now add a table from the ToolBox and add the necessary fields that you want to add to the report.
Now from the solution explorer right-click on your report and then deploy the report. Once the report is deployed, rebuild the project. Now add an output menu item for your report and place it in “Menu Extension” as per client’s requirement.
Need help? Connect Atul
- D365 Data entitiy Insert method COC - October 30, 2024
- D365 Joins - October 16, 2024
- D365 Find method and Exist method - October 9, 2024