Avatar of SandieT04
SandieT04Flag for United States of America

asked on 

Crystal ASP.NET Fails on Windows Server 2003

We have a Crystal report defined in an ASP.NET application.  This web application works fine and displays the report on development machines (Windows XP Pro w/ IIS 5.1) and on a Windows 2000 server (IIS 5.1).  We have an ASPNET SQL user defined on all databases -- identically -- that is being used as the logon for the Crystal engine.  However, when we deploy the exact same code to a Windows 2003 Server machine with IIS 6.0 we get the following error:

Logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:

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


We have tried following instructions provided by Business Objects, etc.   But can find no solution to this problem.  Unfortunately this problem is the only problem holding this project up from User Acceptance testing.  Hopefully someone can provide us a solution -- please!

Crystal Reports

Avatar of undefined
Last Comment
Avatar of ladylinet

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of SandieT04
Flag of United States of America image


Hotfix for what?  IIS is up to date.   We have not applied hotfixes to VS.NET or Crystal.


Permissions on IIS 6.0 for ASPNET?   We did give full permission to that user account for the Crystal Web viewer in IIS.  Do you mean something else?
Avatar of Mike McCracken
Mike McCracken

Hot fix or service pack for Crystal.Net

Start here


Avatar of SandieT04
Flag of United States of America image


Thanks.  We will try that and report back.
Avatar of SandieT04
Flag of United States of America image


We applied the Hotfix and it made no difference at all :-(
Avatar of SandieT04
Flag of United States of America image


We applied the Hotfix for both developing machine and Win 2003 server. It does not help.

We also tried to use IIS 5.0 Isolated Mode for our Win 2003 Server.

Avatar of SandieT04
Flag of United States of America image


One additional piece of information that may or may not be helpful.  We did just upgrade the server from Windows 2000 to 2003.
Avatar of ladylinet

1) Take a look at this article:
2) Also, maybe this can be helpfull:
 Check the references for the following assemblies:

· CrystalDecisions.CrystalReports.Engine
· CrystalDecisions.Reportsource
· CrystalDecisions.Shared
· CrystalDecisions.Web
· CrystalDecisions.Windows.Forms

If you are using the bundled version of Crystal Reports, then the references should be version 9.1.5000.

If you are using the full version of Crystal Reports 9 (developer edition or higher), then the references should be version 9.2.3300.

 Remove the references with the incorrect version and replace them with the references with the correct version.

Avatar of kssaran


This is the the common Issue with the Authentication for the tables used in the Crytal Report. just by passing the connection info in online (like rptInvoice.connect = bla..bla..blaa.. ) will not solve the purpose. You need to pass the connection information to each and every tables in the crystal report like given below. I am sure this could be the cause for the above mentioned error. Try this

    Private Sub LogonToDatabase(ByVal ReportTables As CrystalDecisions.CrystalReports.Engine.Tables, ByVal ServerName As String, ByVal UserId As String, ByVal Password As String)
    ' To Supply Logon Information to each and every Tables used in the Report
        Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
        Dim myLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
        myConnectionInfo.UserID = UserId
        myConnectionInfo.Password = Password
        myConnectionInfo.ServerName = ServerName
        myLogonInfo.ConnectionInfo = myConnectionInfo
        For Each myTable In ReportTables
    End Sub

'For the Above mentioned Function you need to pass the parameter something like. Please note that If you have subreports even that needs to be autenticated seperately

        Dim mySection As CrystalDecisions.CrystalReports.Engine.Section
        Dim myReportObject As CrystalDecisions.CrystalReports.Engine.ReportObject
        Dim mySubReport As CrystalDecisions.CrystalReports.Engine.SubreportObject
        Dim mySubReportDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument

        'Loop through each section of the main report

        For Each mySection In myReport.ReportDefinition.Sections
            'Drill down into the section to see if there are any sub-reports
            For Each myReportObject In mySection.ReportObjects
                If myReportObject.Kind = _
                    CrystalDecisions.[Shared].ReportObjectKind.SubreportObject Then
                    mySubReport = CType(myReportObject, _

                    'Get a reference to the sub-report object
                    'so we can change its properties
                    mySubReportDoc = mySubReport.OpenSubreport(mySubReport.SubreportName)
                    'Set the logon credentials
                    LogonToDatabase(mySubReportDoc.Database.Tables, ServerName, UserId, Password)
                End If
Avatar of SandieT04
Flag of United States of America image


We do pass info to every table.  That is not the problem

We think we have narrowed the problem down to something caused by the upgrade from Windows 2000 to Windows 2003.   Here's why:

*  We upgraded that server from 2000 to 2003  (call it SERVER1)
*  The logon exception occurred  running on SERVER1 pointing to DB1
*  We setup an alternate server with a clean install of Windows 2003  ("SERVER2")
*  We deployed to this new server (SERVER2) but still pointing to the same database (DB1) -- the application worked!!!

We do not know why the connectivity between SERVER1 and DB1 is hosed up but we do not believe it is the database (SQL SERVER 2000) -- we truly believe it has something to do with the upgrade to Windows 2003.  

Our course now will be to wipe out SERVER1 and do a clean install of Windows 2003 and try again.

Thanks for everyone's help -- and if anyone knows why this upgrade may have killed the connectivity to SQL Server 2000 (on the same physical machine) -- please let us know.

Avatar of Sandeepk1999

I have found that even if the field names are wrong (for some reason stored procedures changed) then also you get Logon failed error. This is just to let you guys know that you might want to look in that too...
Crystal Reports
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo