R
Rajesh
I'm still strugling with this error after a whole work day.
Hope someone can help me with this.
I have 2 crystal reports, both binded by datasets. But one dataset is an sql
statement and another is from a stored procedure. When I use the
crystalwebviewer with the report1(dataset from sql statement), I dont have
any problems. I see the report clearly.
But when I use the report2(dataset from stored procedure), I get the "Logon
Failure" error.
I use the following code for logoninfo.
Even if I put try-catch statements, this particular exception is not quite
caught.
I've researched a lot in google on this. Hope someone can help me find a
solution.
Thanx in advance.
SqlConnection1.Open()
SqlSelectCommand1.Parameters("@wris").Value = "SX21225004"
SqlSelectCommand1.ExecuteNonQuery()
SqlDataAdapter1.Fill(DsExecSumm1, "usp_ExecSumm_SELECT")
'Create an instance of the strongly-typed report object
crReportDocument = New execsumm()
'Create a new instance of the connectioninfo object and
'set its properties
crConnectionInfo = New ConnectionInfo()
With crConnectionInfo
..ServerName = "server"
..DatabaseName = "dname"
..UserID = "uid"
..Password = "pwd"
End With
'Get the tables collection from the report object
crDatabase = crReportDocument.Database
CrTables = crDatabase.Tables
'Apply the logon information to each table in the collection
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = crReportDocument
SqlConnection1.Close()
Hope someone can help me with this.
I have 2 crystal reports, both binded by datasets. But one dataset is an sql
statement and another is from a stored procedure. When I use the
crystalwebviewer with the report1(dataset from sql statement), I dont have
any problems. I see the report clearly.
But when I use the report2(dataset from stored procedure), I get the "Logon
Failure" error.
I use the following code for logoninfo.
Even if I put try-catch statements, this particular exception is not quite
caught.
I've researched a lot in google on this. Hope someone can help me find a
solution.
Thanx in advance.
SqlConnection1.Open()
SqlSelectCommand1.Parameters("@wris").Value = "SX21225004"
SqlSelectCommand1.ExecuteNonQuery()
SqlDataAdapter1.Fill(DsExecSumm1, "usp_ExecSumm_SELECT")
'Create an instance of the strongly-typed report object
crReportDocument = New execsumm()
'Create a new instance of the connectioninfo object and
'set its properties
crConnectionInfo = New ConnectionInfo()
With crConnectionInfo
..ServerName = "server"
..DatabaseName = "dname"
..UserID = "uid"
..Password = "pwd"
End With
'Get the tables collection from the report object
crDatabase = crReportDocument.Database
CrTables = crDatabase.Tables
'Apply the logon information to each table in the collection
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = crReportDocument
SqlConnection1.Close()