Link to home
Start Free TrialLog in
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!

Thanks,
Sandie
ASKER CERTIFIED SOLUTION
Avatar of ladylinet
ladylinet

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 SandieT04

ASKER

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

ASP.NET 1.1

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
http://support.businessobjects.com/fix/hot/mhf/default.asp?ref=search_default.asp

mlmcc

Thanks.  We will try that and report back.
We applied the Hotfix and it made no difference at all :-(
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.

One additional piece of information that may or may not be helpful.  We did just upgrade the server from Windows 2000 to 2003.
1) Take a look at this article:
http://support.businessobjects.com/library/kbase/articles/c2013308.asp
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.

FYKI,

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
            myTable.ApplyLogOnInfo(myLogonInfo)
        Next
    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, _
                        CrystalDecisions.CrystalReports.Engine.SubreportObject)

                    '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
            Next
        Next
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.

Sandie
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...