Export a Crystal Report to HTML40 file.

  • Thread starter Thread starter Geir Holme
  • Start date Start date
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()
 
Hi Geir,

I'm not familiar with Crystal Report , it is supported by CrystalReport(
www.businessobjects.com), although it's included in VS.NET.

But from the Exception type, it seems it did not give the full exception
message. Did you get this exception message when running with Debugging? If
yes, You may try run your program without debugging (Ctrl+F5) to get the
full error info. Then you may see the innerexception and the error message,
maybe it will give you more information about this problem.

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
Back
Top