Pro SQL Server 2012 Reporting Services

(sharon) #1

CHAPTER 9  RENDERING REPORTS FROM .NET APPLICATIONS


Now click Run. This renders the Employee Service Cost report. You will be prompted to supply
parameters once the report begins to render in the web browser object. You may also need to use the
name of your report server where you see localhost in the preceding URL. At this point, you should see
something like Figure 9-2.

Figure 9-2. SSRS Viewer WBC application running the Employee Service Cost report

Next, we will add some code so that when the program is started it will set up a default string in the
URL textbox with a path to the report, so you don’t have to type it in each time. Right click on your
ViewerWBC.cs file and select view code to pull up the section where you need to add this code.

public ViewerWBC()
{
InitializeComponent();
// Setting the initial URL for convenience in the example
reportURL.Text = "http://localhost/reportserver/?
/Pro_SSRS/Chapter_9/EmployeeServiceCost&rs:Command=Render";

This is a very simple application and uses simple controls that every user should have available on
their client. You can use the combination of this type of viewer with the URL commands we have
discussed to include a custom report viewer in any application that you might build. Next, we will use a
Free download pdf