Sample Header Ad - 728x90

How can I override the default values for a parameter in a report?

1 vote
1 answer
2010 views
I have a report with a parameter that usually gets its default values by running a query that takes another parameter as it's input. This works fine when the report is run interactively. However, I have a requirement to call this report from code where all the filters are supplied by the code. The code I have for the other parameters works fine: string report = "Analysis/Report.aspx?ReportPath=/MyReport"; string fullReportPath = string.Format("{0}&LocationId={1}&BatchNumber={2}&SearchReference={3}", report, locationId, batchNumber, reference); RunReport(fullReportPath); There is a drop down where the both the available values and default values are retrieved from the database via a query which has the locationId as a parameter. This is so all the values are selected by default. What do I need to change in the report and/or the code so it works as it does now and I can supply the selected values for this drop down as a parameter? I've found [this blog post](https://www.timmitchell.net/post/2012/02/07/conditional-default-values-in-ssrs/) which uses the concept of internal or hidden control parameters to use when setting the values of other parameters, but the example given just sets the other parameter to a default value or leaves it blank. I need for the parameter to run the current query.
Asked by ChrisF (302 rep)
Mar 12, 2019, 11:54 AM
Last activity: Mar 13, 2019, 02:53 PM