SSRS : Transforming Data into Actionable Reports
1. Data Provider (DP) Class: Providing Data for the Report
The Data Provider (DP) class in SSRS is responsible for fetching and structuring the data required for a report. It retrieves data from databases or other sources and passes report parameters to the Report’s RDL through a Data Contract class. Essentially, it prepares and provides the necessary data for the report to function correctly.
Implementation Steps:
Use the [SRSReportParameterAttribute] to link the DP class with the Data Contract class.
Implement the processReport() method in the DP class to populate the three temporary tables that will hold the report’s data.
2. Data Contract Class: Defining and Handling Report Parameters
The Controller class acts as a bridge between the user interface and the reporting process, managing data flow and handling user interactions like passing parameters & defines the report’s parameters, including hidden ones, such as the RecId of a sales agreement, ensuring the correct data is used in the report.
Implementation Steps:
Use the [DataMemberAttribute] to define the parameters.
Ensure the RecId parameter is marked as hidden by using the appropriate attributes.
3. Temporary Tables: Storing Data for the Report
To store the data that will be displayed in the report, three temporary tables need to be created. These tables will hold the processed data and ensure smooth report generation.
Implementation Steps:
Create three tables with appropriate fields and relationships to match the data requirements.
Populate these tables within the processReport() method of the DP class.
4. Controller Class: Managing the Report Dialog
The Controller class manages the report’s dialog form and design, passing the hidden RecId parameter to the report & handles report parameters like filters or options, allowing user inputs before generating the report. Together, these components ensure smooth report generation with accurate, user-defined data.
Implementation Steps:
Extend the SrsReportRunController class.
Override methods as needed to customize the dialog form and set default parameters for the report.
5. Menu Items: Accessing the Report
Menu items provide easy access to the report, both for direct viewing and parameter input.
Implementation Steps:
Create two menu items in the AOT:A Display Menu Item that opens the report viewer directly.An Action Menu Item that opens the dialog form for parameter input.
6. Security Artifacts: Securing Access to the Report
To ensure that only authorized users can access the report, security artifacts need to be set up.
Implementation Steps:
Create security privileges and duties for the menu items.
Assign these privileges and duties to the appropriate roles.
7. Testing the Report: Ensuring Accuracy and Functionality
Once everything is set up, it’s crucial to test the report thoroughly to ensure that all data, parameters, and layouts are functioning as expected.
Implementation Steps:
Verify that data is populated correctly in the temporary tables.
Ensure that the parameters are passed correctly to the report.
Check the report’s layout to confirm it aligns with the requirements.
Conclusion:
By following the above steps, you can successfully create an SSRS report in Dynamics 365. This modular approach ensures clarity and maintainability while ensuring that the report meets all the requirements.