Create an SSRS Report using Data Provider class in Dynamics 365 Finance and Operations

Create an SSRS Report using Data Provider class in Dynamics 365 Finance and Operations

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:

  1. Report Creation: Start by creating a new item report named PKR_InvertTrans.
  2. Dataset Configuration: Add the PKR_InvertTransDP class into the report’s dataset.
  3. Design Layout: Drop your dataset into the "Designs" section and configure the style template and other parameters according to your reporting requirements.

Menu Configuration

Now, let's set up a menu item for easy access to your report:

  1. Menu Item: Create an output menu item named PKR_InvertTrans.
  2. Labeling: Give it a meaningful label that describes the purpose of the report.
  3. Object Type: Specify "SSRSReport" as the object type.
  4. Report Selection: In the Object field, select your created report, "PKR_InvertTrans."

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!





Dominique Zarco

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

回复

要查看或添加评论,请登录

Muhammad Ahmad Siddiqui的更多文章

社区洞察

其他会员也浏览了