Information générale
Titre:
Convert Crystal report to PDF file
Hi All,
I have written the code for converting crystal report into PDF file. But I am getting the error saying,
[ An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in ABC.exe
Additional information: Exception has been thrown by the target of an invocation.]
Could anyone please let me know, what's wrong in this code?
-----------------------------------------------------------------
Try
' Declare variables and get the export options.
_reportObject = New rptCompanyListing()
Dim exportOpts As New ExportOptions()
Dim diskOpts As New DiskFileDestinationOptions()
exportOpts = _reportObject.ExportOptions
SetParameterValue(0, _company)
SetParameterValue(1, _phone)
SetParameterValue(2, _fax)
' Set the export format.
exportOpts.ExportFormatType = _
ExportFormatType.RichText
exportOpts.ExportDestinationType = _
ExportDestinationType.DiskFile
' Set the disk file options.
diskOpts.DiskFileName = "C:\xxx.Pdf"
exportOpts.DestinationOptions = diskOpts
' Export the report.
_reportObject.Export()
Catch eException As Exception
Throw eException
End Try
------------------------------------------------------------------------
Thanks in Advance,
Ravi
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement