Create an SSRS Report using Data Provider class in Dynamics 365 Finance and Operations
Muhammad Ahmad Siddiqui
Software Engineer @Devsinc | Bachelor of Science in Computer Science
Dynamics 365 Finance and Operations provides powerful tools for creating custom reports. In this guide, we'll walk you through the detailed steps to create an SQL Server Reporting Services (SSRS) report within your Dynamics 365 Finance and Operations environment. Specifically, we'll be creating a report called PKR_InvertTrans to showcase the process.
Classes
Before we dive into report creation, let's establish two essential classes for our report:
Data Contract Class
This class is designed for parameter passing:
[DataContract]
public class PKR_InvertTransContact {
ItemId itemId;
[DataMemberAttribute('ItemId'), SysOperationLabelAttribute(literalStr('Item Id')), SysOperationControlVisibilityAttribute(false)]
public ItemId parmItemId(ItemId itemId = itemId){
itemId = itemId; return itemId;
}
}
Data Provider Class
This class acts as a data provider, where we execute our business logic:
[SRSReportParameterAttribute(classStr(PKR_InvertTransContact))]
public class PKR_InvertTransDP extends SRSReportDataProviderBase {
PKR_InventTransTmp invertTransTmp;
[SrsReportDataSet(tableStr(PKR_InventTransTmp))]
public PKR_InventTransTmp getPKR_InvertTransTmp() {
select invertTransTmp;
return invertTransTmp;
}
public void processReport() {
PKR_InvertTransContact contract = new PKR_InvertTransContact();
InventTrans invertTrans; // another table contract =
this.parmDataContract() as PKR_InvertTransContact; ItemId itemId =
contract.parmItemId();
insert_recordset invertTransTmp(ItemId, Qty, VoucherPhysical)
select ItemId, Qty, VoucherPhysical from invertTrans
where (invertTrans.ItemId == itemId || itemId);
}
}
Report Creation
Let's go step-by-step in creating the report:
领英推荐
Menu Configuration
Now, let's set up a menu item for easy access to your report:
Great job! You've successfully created your SSRS report in Dynamics 365 Finance and Operations.
If you found this guide helpful, don't forget to follow and like for more useful tips and tutorials! Happy reporting!
D365FnO, Powert Platform developer, Team and Project Manager dedicated to empower companies to improve performance and bottom line.
10 个月You forgot a crititcal ethical behavior: credit and references of your claims! PKR stands from Pir Khurram Rashdi (https://www.youtube.com/watch?v=CTvKf1_LJY4) where he teaches you what you posted. Great post, just give credit to the original creator...