Pro SQL Server 2012 Reporting Services

(sharon) #1
CHAPTER 9  RENDERING REPORTS FROM .NET APPLICATIONS

/Pro_SSRS/Chapter_9/EmployeeServiceCost";
GetParameters reportParameters = new GetParameters(reportURL.Text);
if (reportParameters.ShowDialog() == DialogResult.OK) {
reportViewer.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Remote;
reportViewer.ServerReport.ReportServerUrl =
new Uri(@"http://localhost/reportserver/");
reportViewer.ServerReport.ReportPath =
"/Pro_SSRS/Chapter_9/EmployeeServiceCost";
reportViewer.ServerReport.SetParameters(reportParameters.Parameters);
reportViewer.ShowParameterPrompts = false; reportViewer.RefreshReport(); } }


Now run the project in debug mode. When the form displays, click the button labeled Parameters.
The Parameters dialog form will be displayed. Select some parameters from the available drop down
values, and click OK. This renders the Employee Service Cost report, which is located on the SSRS 2012
server, using the parameters you have supplied and it won’t prompt you to supply any additional
parameters. At this point, you should see something that looks like Figure 9-10.


Figure 9-10. The finished report using your parameters

Free download pdf