CHAPTER 9 RENDERING REPORTS FROM .NET APPLICATIONS
Creating the Viewer Form
In this example, you will use C# to create the viewer application. We will also include the same
application written in VB.NET in the extra downloadable content. Follow these steps:
- Open Visual Studio 2010.
- Create a new project.
- On the New Project dialog box, select Visual C# ➤ Windows ➤ Windows Forms
Application. Name it SSRS Viewer WBC. Under Solution, select Create New
Solution, and name it Chapter 9. Click OK to create your project.
Now that you have created the project, you’ll work with the form you will use to create the report
viewer:
- Visual Studio 2010 will add a single form to the project called Form1.cs.
Rename the form to ViewerWBC.cs. - Resize the blank form to 800×600.
- Add the WebBrowser control from the Toolbox’s Common Controls section to
the form. Name it WebBrowser, and anchor the control to the form’s top,
bottom, left, and right. Size the WebBrowser control to extend from both sides
of the form to the bottom of the form. - Now add a textbox, and name it reportURL. Just after the textbox, add a button
named reportRun, and set the button text to Run.
You should now have a form that looks like Figure 9-1.