当我尝试从应用程序调用报告时出现此错误。我的报告在报告服务器上正常工作。
我正在使用以下代码:
Private Sub ShowJobTravelerReport(ByVal strworkORdeID As String, ByVal strQAFormID As String, ByVal strReportName As String)
Dim paramList As New Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)
paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("WorkOrderID", strworkORdeID, False))
paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("QAFormID", strQAFormID, False))
showReport(strReportName, paramList)
End Sub
Private Sub showReport(ByVal strReportName As String, ByRef paramList As Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter))
Try
' Load data only when displaying the page for the first time
If (Not Me.IsPostBack) Then
Dim newuri As New Uri(System.Configuration.ConfigurationManager.AppSettings("MyReportViewerUrl").ToString())
ReportViewer1.ServerReport.ReportPath = System.Configuration.ConfigurationManager.AppSettings("MyReportViewerReportPath").ToString() + strReportName.trim()
ReportViewer1.ServerReport.ReportServerUrl = newuri
' Dim rptcon As
ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
ReportViewer1.ServerReport.SetParameters(paramList)
End If
Catch ex As Exception
' An error has occured so display an error message.
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
End Try
End Sub
我的 Web.Config 文件在下面..
<add key="ReportViewerServerConnection" value="MyReportServerConnection, App_Code" />
<add key="MyReportViewerReportPath" value="/Reports/" />
<add key="MyReportViewerUrl" value="http://MyServer:port/Reports" />
<add key="MyReportViewerDomain" value="*******" />
<add key="MyReportViewerPassword" value="******" />
<add key="MyReportViewerUser" value="******" />
有人可以帮我解决这个问题。