How to create an SSRS Report in Microsoft Dynamics 365 F&O

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.

Table properties in Dynamics 365 F&O

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.

Report Datasource Microsoft Dynamics 365 F&O

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”.

Report Datasource Edit Microsoft Dynamics 365 F&O

Now add a table from the ToolBox and add the necessary fields that you want to add to the report.

Report Design Microsoft Dynamics 365 F&O

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

Atul Yadav
Latest posts by Atul Yadav (see all)

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *