1. First of all open Visual Studio 2010 and go to File-> New-> Project.
2. A New Project window opens. In that window select Visual C# from left pane and select Windows Forms Application as shown in below screenshot.
Then click on OK button.
3. Visual Studio 2010 will add a single form to the project calledForm1.cs. Rename that form to ViewerForm.cs.
4. Resize that form to 1024 x 768 dimension.
5. Now add a ReportViewer control named as rptViewer from Reportingcontrols.
6. Then add a textbox, and name it txtReportURL. Also add a button namedbtnShowReport and set the button Text property to Show Report. Now your form design looks like below:
7. Now write below code into the click event of Show Report button.
1
2
3
4
5
6
7
| private void btnShowReport_Click( object sender, EventArgs e) { rptViewer.ProcessingMode = ProcessingMode.Remote; rptViewer.ServerReport.ReportPath = txtReportURL.Text; rptViewer.RefreshReport(); } |
8. Now press F5 button. In textbox enter the Path to access the report which is something like below :
/StartSSRS/PersonWithPhoneNumber
9. Then click on Show Report button. You will see result looks like below :