Monday, March 19, 2012

How to use Reportviewer to open a SSRS Report

I'm trying to open a report using the following code:

Dim strReportPathAs String Select Case Request.QueryString("Report")Case"Report1" strReportPath ="/reportfolder/report1&val1=" & Request.QueryString("1") &"&=" & Request.QueryString("datefrom") &"&dateto=" & Request.QueryString("dateto") &"&severity=" & Request.QueryString("severity") &""Case"Report2" strReportPath ="/reportfolder/report2&val1=" & Request.QueryString("1") &"&=" & Request.QueryString("datefrom") &"&dateto=" & Request.QueryString("dateto") &"&severity=" & Request.QueryString("severity") &""Case"Report3" strReportPath ="/reportfolder/report3&val1=" & Request.QueryString("1") &"&=" & Request.QueryString("datefrom") &"&dateto=" & Request.QueryString("dateto") &"&severity=" & Request.QueryString("severity") &""End Select With ReportViewer1 .ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote .ServerReport.ReportServerUrl =New Uri(http://myserver/reportserver") .ServerReport.ReportPath = strReportPath .ServerReport.Refresh()End With

I get the following error:

The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.The request failed with HTTP status 404: Not Found.

I can run the reports without any issues on the report server. I'm using Visual Studio 2005.

Can anyone see where I'm going wrong?

Thanks in advance.

I've found that my problem is that I'm using SQL2000 and the Reportviewer only works with SQL2005.

No comments:

Post a Comment