General information
Title:
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
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only