• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1160
  • Last Modified:

Report Load Failed

I Created a web site using the tool Iron Speed.  The tool created the ASP.NET web site as a Visual Studio 2005 solution to be run in .NET framwork 2.  In one of the pages it calls a a crystal report version 10.  The report works fine in the development PC which is running Windows XP Version 2002 server pack 3.  Please find the code calling the report.  

The report was deployed using the MSI installer coming with Iron Speed.  As part of the installation the following DLLs related to Crystal are copied in the bin folder of the application.  

CrystalDecisions.CrystalReports.Engine.dll
CrystalDecisions.ReportSource.dll
CrystalDecisions.Shared.dll


The application was installed under C:\Inetpub\wwwroot.  The web site uses windows AD and impersonisation is set to true.  The applicaiton when run for the first time gave errors on the following Crystal assembly lines in web.config.  

        <add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />


I installed vs 2005 on the production server and the error got resolved.  However whenever I invoke the crystal reports it gives the error "Report Load Failed".  

I set permissions on C:\documents and settings,  C:\Windows\temp, C:\Inetpub  Full control for all machine users and for ASPNET, NETWORK SERVICE, IIS_WPG.  Still the error is coming.

Please help to resolve this problem as it has take already 3 days and I am in real trouble.

Regards

Public Sub LoadReport(ByVal sender As Object, ByVal e As System.EventArgs, ByVal reportPath As String)
            Dim crReportDocument As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument

             Dim fileName As String = reportPath

            Try
                If fileName.Substring(1).StartsWith("D:\") Then
                    crReportDocument.Load(fileName)
                Else
                    crReportDocument.Load(Me.Page.MapPath(fileName))
                End If
            Catch ex As Exception
                Dim errMsg As String = ex.Message.Replace(Chr(13).ToString(), "").Replace(Chr(10).ToString(), "")
				errMsg += " Please make sure the dlls for Crystal Report are compatible with the Crystal Report file."
				errMsg += Me.Page.MapPath(fileName)
                BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", errMsg)
            End Try

            Try

                '************If you see a "Missing Parameter Value" error message or if your Crystal Report file requires paarameters,
                '************please uncomment this section & specify appropriate values. 

                Dim paramValue As CrystalDecisions.Shared.ParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue()

                paramValue.Value = Me.employeeIDFilter1.SelectedValue.ToString
                crReportDocument.SetParameterValue("@EmployeeID", paramValue)
                'crReportDocument.SetParameterValue(0, paramValue)

                Dim paramValue2 As CrystalDecisions.Shared.ParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue()
                paramValue2.Value = Me.periodFromFromFilter1.Text
                crReportDocument.SetParameterValue("@FromDate", paramValue2)
                'crReportDocument.SetParameterValue(1, paramValue2)

                Dim paramValue3 As CrystalDecisions.Shared.ParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue()
                paramValue3.Value = Me.periodToFromFilter.Text
                crReportDocument.SetParameterValue("@ToDate", paramValue3)
                'crReportDocument.SetParameterValue(2, paramValue3)

 

                '**********************************************

                '************If you see a 'Logon Failed' error message or if your database requires authentication,
                '************please uncomment this section & specify appropriate values. 



                ''define and locate required objects for db login
                Dim db As CrystalDecisions.CrystalReports.Engine.Database = crReportDocument.Database
                Dim tables As CrystalDecisions.CrystalReports.Engine.Tables = db.Tables
                Dim tableLoginInfo As CrystalDecisions.Shared.TableLogOnInfo = New CrystalDecisions.Shared.TableLogOnInfo()

                ''define connection information
                Dim dbConnInfo As CrystalDecisions.Shared.ConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo()


                Dim connStr As String = ConfigurationManager.ConnectionStrings("xxxx").ToString()
                dbConnInfo.ServerName = GetValueFromDelimetedString("Data Source", ";", "=", connStr)
                dbConnInfo.DatabaseName = GetValueFromDelimetedString("Database", ";", "=", connStr)
                dbConnInfo.UserID = GetValueFromDelimetedString("User Id", ";", "=", connStr)
                dbConnInfo.Password = GetValueFromDelimetedString("Password", ";", "=", connStr)

  


                'BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", "iqbal check")


                ''apply connection information to each table

                Dim table As CrystalDecisions.CrystalReports.Engine.Table
                For Each table In tables
                    tableLoginInfo = table.LogOnInfo

                     tableLoginInfo.ConnectionInfo = dbConnInfo
                    table.ApplyLogOnInfo(tableLoginInfo)
                Next
                '**********************************************


                DisplayReportAsPDF_CrystalReportButton(crReportDocument)


            Catch ex As Exception
                Dim errMsg As String = ex.Message.Replace(Chr(13).ToString(), "").Replace(Chr(10).ToString(), "")
                errMsg += " If this is a deployment machine, make sure network service has permissions to read or write to the windows\temp folder."
                BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", errMsg)
            End Try
        End Sub

Open in new window

0
iquiqu
Asked:
iquiqu
1 Solution
 
Jon WinterburnCommented:
I experienced a similar problem a while ago and I Googled it and found a workaround (not a solution, but it did the job) at this link (David Rollins answer):

http://social.msdn.microsoft.com/forums/en-US/vscrystalreports/thread/9e4c6686-027f-4362-b10a-cb13c45460d8
0
 
louisghCommented:
0
 
iquiquAuthor Commented:
Thanks for the replies.  

I resolved the problem by upgrading reports to XI Release 2 and installing Crystal XI R2 runtime from SAP.  Also, it seems there is a problem with the line

crReportDocument.Load(Me.Page.MapPath(fileName))


I had to replace Me.Page.MapPath(fileName)  with a string variable containing the full path of the crystal report.  For example,

crReportDocument.Load(fileName)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now