I have a report I am developing in BIDS for SSRS 2008 R2 that uses a stored procedure as its data source. I have set up parameters in the report and the report is passing them on to the stored procedure and everything works fine. However, I now need to convert the report so it gets its parameters passed to it from a ReportViewer control in a C# ASP.Net application instead of allowing them to be entered in the SSRS interface. I think I am fine on the C# side (using ServerReport.SetParameters), but I don’t know what to do in BIDS to route those passed-in parameter values to the stored procedure. Can anyone provide an example?
I also need to prevent the report from displaying the UI for entering the parameters. Should I set the parameters to Hidden or Internal?
I would set the report parameters as Internal but read up on this article http://msdn.microsoft.com/en-us/library/aa337234.aspx for the section Hidden and Internal Parameters and decided for yourself what is appropriate to the problem.
Assuming you have a stored proc like
Define 2 report parameters in SSRS (InputText as string, RepeatFactor as integer). Then, in your SSRS, your dataset would be defined like
And then on the Parameters tab of the dataset, it would look like
For completeness of solution, this is an approximation of the code I use to pass parameters in to a report control with an ID of rvReportViewer