G
Geir Holme
Hi all.
Can anyone help me to find out whats missing in the following code. I am
trying to export a report to a html file.
ERROR MESSAGE:
An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
If I use the ExportFormatType = PortableDocFormat it works great.
And, is there anyway I can put this HTML report directly into a mailbody and
send it out via CDO or something else.
Thanks all
-geir
Dim crExportOptions As ExportOptions
Dim crReportDocument = New ReportDocument
Dim crDiskFileDestinationOptions = New DiskFileDestinationOptions
crReportDocument.Load("C:\Documents and Settings\geir\My Documents\Visual
Studio Projects\Tips\CrystalReport3.rpt")
crDiskFileDestinationOptions.DiskFileName = "C:\exportedweb.htm"
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.HTML40
End With
crReportDocument.Export()
Can anyone help me to find out whats missing in the following code. I am
trying to export a report to a html file.
ERROR MESSAGE:
An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
If I use the ExportFormatType = PortableDocFormat it works great.
And, is there anyway I can put this HTML report directly into a mailbody and
send it out via CDO or something else.
Thanks all
-geir
Dim crExportOptions As ExportOptions
Dim crReportDocument = New ReportDocument
Dim crDiskFileDestinationOptions = New DiskFileDestinationOptions
crReportDocument.Load("C:\Documents and Settings\geir\My Documents\Visual
Studio Projects\Tips\CrystalReport3.rpt")
crDiskFileDestinationOptions.DiskFileName = "C:\exportedweb.htm"
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.HTML40
End With
crReportDocument.Export()