通过 VS2012,我连接到报告 Web 服务,需要将“handShake”参数加载到我的报告中,这是一个 ServerReport,而不是 LocalReport。
这是我的 Page_Init 代码:
If (Request.QueryString("handShake") = Nothing) Then
Response.Redirect("~/AccessDenial.aspx")
End If
'' Set up the credentials
ReportViewer1.ServerReport.ReportServerUrl = New Uri(ConfigurationManager.AppSettings("MyReportServerPath"))
ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
Dim objparameter As Microsoft.Reporting.WebForms.ReportParameter
objparameter = New Microsoft.Reporting.WebForms.ReportParameter("handShake", Request.QueryString("handShake").ToString)
ReportViewer1.ServerReport.SetParameters(objparameter)
最后一行代码给了我错误:
The source of the report definition has not been specified."
在很多论坛上,他们说我需要将 serverReport 更改为 localReport 但事实并非如此......
非常感谢您的帮助!