Load Report Failed - CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Invalid Report file path RRS feed

  • Question

  • I am a newbie at this, and I have search all the forums and haven't found the answer I am looking for.  I have four reports and only two of which work,  and the other two show "Load Report Failed."  I have checked the code and they are all the same, the only difference is the number of parameters.   I am not sure if this makes a different but one of my reports' size is 4064KB and this one of the two that came up with the error, it has 4 sub-reports within it.   I have checked my file paths and given them full permissions, and made sure my password and ID are correct.  I am using Crystal Report on VS2010 to export to PDF with a "quick click export button". All the reports work fine on my developing computer, but when I install it on another computer it gives me this issue.  I had installed .net Famework 4 and Crystal Report Redistributable for 4.0 Framework, not sure if I need anything else.  Here is my code for that one with 4 sub-reports, thank you in advance.

                Dim SavingString As String = ""
                'SavingString = "C:\Windows\Temp\" & CStr(Me.MillNameLabel1.Text) & "Quote" & CStr(Me.QuoteNumberLabel1.Text) & ".pdf"
                SavingString = "C:\Reports\" & CStr(Me.MillNameLabel1.Text) & "Quote" & CStr(Me.QuoteNumberLabel1.Text) & ".pdf"
                Dim cryRpt As New ReportDocument
                cryRpt.Load("C:\Program Files\ECSBOM\ECSBOM\ReportTemplates\QuoteReport.rpt")
                cryRpt.SetDatabaseLogon("CrystalReportUser", "123456")

                Dim crParameterDiscreteValue As ParameterDiscreteValue
                Dim crParameterFieldDefinitions As ParameterFieldDefinitions
                Dim crParameterFieldLocation As ParameterFieldDefinition
                Dim crParameterValues As ParameterValues

                crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields

                crParameterFieldLocation = crParameterFieldDefinitions.Item("QuoteNumber")
                crParameterValues = crParameterFieldLocation.CurrentValues
                crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
                crParameterDiscreteValue.Value = CInt(Me.QuoteNumberLabel1.Text)

                ReportViewForm.CrystalReportViewer1.ReportSource = cryRpt

                Dim CrExportOptions As ExportOptions

                Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()

                Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
                CrDiskFileDestinationOptions.DiskFileName = SavingString
                CrExportOptions = cryRpt.ExportOptions
                With CrExportOptions
                    .ExportDestinationType = ExportDestinationType.DiskFile
                    .ExportFormatType = ExportFormatType.PortableDocFormat
                    .ExportDestinationOptions = CrDiskFileDestinationOptions
                    .ExportFormatOptions = CrFormatTypeOptions

                End With
                MainForm.WindowState = FormWindowState.Minimized
            Catch ex As Exception
            End Try

    Wednesday, May 30, 2012 2:14 PM

All replies

  • If I were you I'd double check the version of Crystal Reports on your developer machine versus the version on the users' machine where the code fails. My unchanged code with SAP v13 Crystal Reports threw me CrystalDecisions.CrystalReports.Engine.LoadSaveReportException exception with the message "Invalid report file path". I also got CrystalDecisions.CrystalReports.Engine.InvalidArgumentException exception with the message containing "Invalid printer specified".

    So dig down into the inner exception what the CrytalReports really threw, check out report file paths, printer settings and other properties you set. The new version seems to be more picky about the correctness of parameters.

    Thursday, November 15, 2012 7:29 PM