2.使用TableLogonInfo Dim ReportDoc As New ReportDocument() Dim logonInfo As New TableLogonInfo Dim table As table ReportDoc.Load("C:\Rpts\publish.rpt") For Each table IN ReportDoc.DataBase.Tables logonInfo= table.LogonInfo with logonInfo.connectioninfo .serverName= "Localhost" .Databasename= "pubs" .UserID= "sa" .Password="" End With table.applyLogonInfo(logonInfo) next table Crviewer.reportsource= reportDoc Crviewer.DataBind()
Dim ReportDoc As New ReportDocument()
Dim logonInfo As New TableLogonInfo
Dim table As table
ReportDoc.Load("C:\Rpts\publish.rpt")
For Each table IN ReportDoc.DataBase.Tables
logonInfo= table.LogonInfo
with logonInfo.connectioninfo
.serverName= "Localhost"
.Databasename= "pubs"
.UserID= "sa"
.Password=""
End With
table.applyLogonInfo(logonInfo)
next table
Crviewer.reportsource= reportDoc
Crviewer.DataBind()
请求因 HTTP 状态 404 失败:Not Found。
运行程序时的出错还是如下:
异常详细信息:CrystalDecisions.CrystalReports.Engine.LogOnException: 登录失败。
还得再劳驾各位啦!。