Description:
In this post, we'll walk through the process of creating a multi-select lookup in an SSRS report for Dynamics 365 Finance and Operations (D365FO). This allows the user to select multiple values from the lookup, which can be extremely helpful in various reporting scenarios.
Step 1: Create a Contract Class
To begin, we need a contract class to handle the parameters passed to the report. This class will include a list of item IDs as a parameter for our report.
Contract Class:
Step 2: Create the UI Builder Class
The UI Builder class will generate the form fields and the multi-select lookup button. This class is where we handle user input for the lookup field.
UI Builder Class:
Step 3: Create the Data Provider Class
Next, we define a Data Provider class to retrieve the data based on the selected item IDs. This class will use the list of item IDs passed through the contract.
Data Provider Class:
Step 4: Visual Studio Setup
After defining the necessary classes, follow these steps in Visual Studio to add the report and dataset:
-
Add a Report: Create a new report in Visual Studio and set the appropriate properties.
-
Add a Data Set: Link your data provider class to the report by defining the data set.
-
Set Parameters: In the parameters section of the report, set the
ItemId
parameter to allow blank values. This will enable multi-select functionality.-
Allow Blank = True
-
Nullable = True
-
-
Precision Design: Define the precision design for your report output.
-
Deploy and Run the Report: Once everything is set, deploy the report and execute it to see the multi-select lookup in action.
Conclusion:
This process provides an efficient way to implement a multi-select lookup in SSRS reports in D365FO, allowing users to select multiple items from a lookup to be displayed in the report. By utilizing the contract class, UI builder, and data provider, we ensure that the lookup values are properly handled and integrated into the report.
0 Comments