CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top