Vb.net – Crystal Reports- Export report causing “Missing Parameter Values”

asp.netcrystal-reportsexportparametersvb.net

I am trying to export a report but everytime it runs the code to export the crystal report in the crystalreportviewer I get an error message saying "Missing Parameter Values". I've looked through many sources but havent found a solution. I do know that all parameters are filled in because without the export code, the site runs perfectly fine.

Export code

Try
            Dim CrExportOptions As CrystalDecisions.Shared.ExportOptions
            Dim CrDiskFileDestinationOptions As New  _
            CrystalDecisions.Shared.DiskFileDestinationOptions()
            Dim CrFormatTypeOptions As New CrystalDecisions.Shared.PdfRtfWordFormatOptions()
            CrDiskFileDestinationOptions.DiskFileName = _
                                        "c:\crystalExport.pdf"
            CrExportOptions = oRpt.ExportOptions
            With CrExportOptions
                .ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
                .ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
                .DestinationOptions = CrDiskFileDestinationOptions
                .FormatOptions = CrFormatTypeOptions
            End With
            oRpt.Export()
        Catch ex As Exception
            Response.Write(ex.ToString)
        End Try

Also:

  'Try
        '    oRpt.ExportToHttpResponse([Shared].ExportFormatType.PortableDocFormat, Response, True, "ExportedReport")
        'Catch ex As Exception
        '    Response.Write(ex.ToString)
        'End Try

Any help would be great.

Best Answer

This is caused under 2 reasons. Either, you're not passing(from the program) a required parameter which you have created in the report. Or, you're passing a parameter to the report but you haven't created it in the report.

Related Topic