CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

I am trying to access a Crystal Report through an ASP.NET page.  The access works just fine until the page is refreshed.  Then I receive the following error:
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

I have tried the push and pull methods.  I have read other posts that people getting this same error had success with datasets.  I get the same error.  I have checked permissions in SQL, IIS, and on the directory where the reports are.

I'm sure this KB article applies to my problem:
http://support.microsoft.com/default.aspx scid=kb;en-us;319264
but I could not get the resolution listed to work.

Thanks for any help!
~Heidi




Answer this question

CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

  • akgottlieb

    Thanks Keith!

    I tried that SimpleLogonEngine and I still get the same error. Here is stack trace if it helps:

    LogOnException: Logon failed.]
       . F(String , EngineExceptionErrorID
    )
       . A(Int16 , Int32 )
       . @(Int16 )
       CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext)
       CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext)
       CrystalDecisions.Web.ReportAgent.u(Boolean N)
       CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
       System.Web.UI.Control.PreRenderRecursiveInternal() +62
       System.Web.UI.Control.PreRenderRecursiveInternal() +125
       System.Web.UI.Control.PreRenderRecursiveInternal() +125
       System.Web.UI.Page.ProcessRequestMain() +1499

    Thanks again for your help!


  • gladwin

    Hello Heidi,

    Does your original report (the one with charts) has Saved Data with it Did you design this in a standalone report designer or using the embedded report designer in Visual Studio How did you connect to the database to create this report (ODBC, OLE DB, Native connection) Is the ASP.NET server the same machine as the report designer

    If your report has saved data then it will preview fine to start, but it will be using the data that you had at design time.  When you go to refresh it will then try to hit the database for the data. I would ensure that the report does not have saved data (in the report designer go to the file menu and unselect the Save Data with Report option) then save the report and try running it from your web page.

    If you designed this report on another machine then it is possible that the ASP.NET server does not have the database client (access to SQL) or the ODBC datasource properly setup.

    Keith - Business Objects

  • Tommi Grönlund

    Hello Heidi,

    To clarify, the report works fine when you first load the web application but not on refreshes How about when you page through the report

    If it works on first load then I don't think that the Microsoft Kbase article applies to you.

    How do you load the report Is this done in a button click or other type of event You might want to check out this article.

    http://support.businessobjects.com/library/kbase/articles/c2012164.asp

    If that doesn't apply to you then I would need more information to be able to offer other ideas.

    - Crystal Reports specific code and where you set it
    - Database that you are logging into
    - Report Design; subreports, special fields etc.
    - Does this happen to all reports

    Keith - Business Objects

  • a_r_satish

    Hello Heidi,

    Can you look at some of the sample .NET web applications that available from the Business Objects web site

    http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_web_samples.exe.asp

    Will put a number of zipped sample applications on your machine.  The one to look for is vbnet_web_simplelogonengine.zip.

    This is a simple application that uses the Crystal Report engine (not the viewer) to log on to the database.

    I would look at using your report with this sample and changing the logon info in code to match your systme.

    Keith - Business Objects

  • jnstaub

    Hi Keith!  Thanks for the help!

    Yes - it I can page through the report just fine.

    Here is more info:
       Database:  SQL Server 2k
       Report Design:  The reports only display charts.  They use a couple of formula fields and a couple of running totals.  I now have a small subreport in them.
    When I make a Windows App with these reports I don't have any problems loading or refreshing them.

    So far this has happened on all reports.  I have made plain ol'vanilla test reports that just display data - I get the same error.

    I have tried different ways of loading the report.  

    Just setting the properties on the CrystalReportViewer then
    crystalreportsviewer1.databind()

    then..
    Since it appeared to me that it was sometype of logon problem I tried code to log on to the viewer -
    CrystalReportView1.LogonInfo = New CrystalDecisions. Shareed.TableLogOnInfos
    rptLogOnInfo = New CrystalDecisions.Shared.TableLogOnInfo()
    rptLogOnInfo.TableName = "rptCharts"
    rptLongonInfo.ConnectionInfo.UserID = UserID
    rptLongonInfo.ConnectionInfo.password = password
    CrystalReportView1.LogOnInfo.Add(rptLogonInfo)

    When that didn't work I tried to logon using the ReportDocument.  Then I tried making a dataset to use with the report.  I won't list all the code here (unless you really want it).  Stepping through the code - the dataset gets populated just fine, but when the report is called I get the error again.

    hope this helps - I didn't want to get to lengthy.
    Thanks!
    Heidi







  • CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.