FlashGorden
IS-IT--Management
Hi All
I am trying to use the Crystal Web Viewer in .NET, but I get the following error:Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
My code is as follows:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class cry_test
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
Dim cr As CrystalReport1 = New CrystalReport1()
Dim crTable As TableLogOnInfo = New TableLogOnInfo()
Dim crconn As ConnectionInfo = New ConnectionInfo()
Dim crdb As CrystalDecisions.CrystalReports.Engine.Database
Dim crtbls As CrystalDecisions.CrystalReports.Engine.Tables
Dim crtbl As CrystalDecisions.CrystalReports.Engine.Table
Dim sever As HttpServerUtility
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
Me.CrystalReportViewer1.DataBind()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
CrystalReportViewer1.ReportSource = Server.MapPath("\test_hr_db\CrystalReport1.rpt"
'CrystalReportViewer1.ReportSource = " CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.ServerName = "my server"
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.UserID = "user name"
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.Password = "pwd"
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.DatabaseName = "database name"
End If
End Sub
End Class
Any help woul be appreicated.
Thanks
I am trying to use the Crystal Web Viewer in .NET, but I get the following error:Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
My code is as follows:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class cry_test
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
Dim cr As CrystalReport1 = New CrystalReport1()
Dim crTable As TableLogOnInfo = New TableLogOnInfo()
Dim crconn As ConnectionInfo = New ConnectionInfo()
Dim crdb As CrystalDecisions.CrystalReports.Engine.Database
Dim crtbls As CrystalDecisions.CrystalReports.Engine.Tables
Dim crtbl As CrystalDecisions.CrystalReports.Engine.Table
Dim sever As HttpServerUtility
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
Me.CrystalReportViewer1.DataBind()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
CrystalReportViewer1.ReportSource = Server.MapPath("\test_hr_db\CrystalReport1.rpt"
'CrystalReportViewer1.ReportSource = " CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.ServerName = "my server"
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.UserID = "user name"
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.Password = "pwd"
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.DatabaseName = "database name"
End If
End Sub
End Class
Any help woul be appreicated.
Thanks