7 Answers, 1 is accepted
Other approach is to use custom UI where the selected values are passed to the viewer by updating its reportSource - How To: Pass Values to Report Parameters.
Let us know if you have any further questions.
I am already using a custom parameter editor. The issue is that all of my reports use the same calendar widget, which uses the same custom parameter editor.
What I would like to be able to do is, for example: on one report, prevent users from selecting more than one week at a time. On another report, prevent users from selecting more than one month at a time. Basically, I'd like to be able to set date restrictions on a per report basis. What do you suggest?
The mechanism for plugin a custom editor allows you to apply a match criteria which includes the parameter's type, name and etc properties. You can also use external variables which may provide information about the report. If there is match the corresponding createEditor will be triggered.
For example a match like:
You are not limited to provide one custom editor on creating the viewer object, the can be multiple match-createEditor entries for different cases.
Other approach is to use custom UI to update the viewer's reportSource - How To: Pass Values to Report Parameters.
I hope this information helps.
Thank you for the clarification. I will try this approach and post back when I have more to share.
Thanks again, Stef. I was able to accomplish what I was after by matching on the report name using a helper function I call inside the custom parameter editor. Let me know if you have any further suggestions to my code. Example below.
We can suggest you several approaches:
- The current approach, where the input is limited through the viewer's parameters area. You will have to update parameter editors with custom widgets preventing the user from selecting undesired values. Related to the How To: Create a Custom Parameter Editor help article;
- Use entirely custom UI, where you will have full control on the input - you will be able to specify the used widgets and their settings. Please check the example in How To: Pass Values to Report Parameters.
- Handle the input in the report or/and the data-retrieval method and add a TextBox displaying information about the changed selection. For example, let the user select any values via report parameters and validate these values in the data-retrieval method before using them to get data.
In case a report parameter value has to be updated based on other parameter's value, you can also implement cascading parameters - How to: Cascading Parameters with applied filtering on data source level.