Link to home
Start Free TrialLog in
Avatar of Heritagecomputer
Heritagecomputer

asked on

Crystal Reports-logon failed error

whenver i design a crystal report from within dot net environment, it gives me this error
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
the code i have used is as follows:

Dim rpt As ReportDocument
        rpt = New ReportDocument
        CrystalReportViewer1.DataBind()
        rpt.Load("c:\inetpub\wwwroot\west\reports\rep1.rpt", OpenReportMethod.OpenReportByDefault)
        rpt.SetDatabaseLogon("sa", "123", "server1", "eastdb")
        CrystalReportViewer1.ReportSource = rpt
        CrystalReportViewer1.ShowFirstPage()
somebody please tell me, where i m wrong!!!
Avatar of frodoman
frodoman
Flag of United States of America image

One thing about "SetDatabaseLogon" is that it only works if you're connecting to the same db that was used to design the report - if you're connection to another db (say a production vs. development) then this method will not work (ref: http://support.businessobjects.com/library/kbase/articles/c2013545.asp).

Otherwise the obvious thing is to check that the credentials are accurate - I don't see any problem with the code itself.

frodoman
If your report involves subreports then you may need a hotfix: http://support.businessobjects.com/library/kbase/articles/c2012317.asp

frodoman
Avatar of srini5474
srini5474

this is no problem with your application, every time u newly connect/Edit Existing  DB using CrystalReporter... Do the following..................
Open ur Crystal reporter.
open field Explorer
Right click Database fields tree menu.
click on verify Database.
and click ok on following pop up windows. Ur DB will be refreshed..

i suppose ur problem should have been solved by now :-)

Regards
Srinivasan.S
ASKER CERTIFIED SOLUTION
Avatar of ebolek
ebolek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Heritagecomputer

ASKER

Thanks.