Skip to content

Exporting to HTML using Crystal Reports

lisa

Asked Oct 21, 2005, 8:37 AM EDT1 answer
Share
LinkedInX

I am exporting my report to an html file using Crystal Reports.  I'm using the following code:

C#
HTMLFormatOptions htmlOpts = new HTMLFormatOptions();
htmlOpts.HTMLBaseFolderName = @"C:\Temp\";
htmlOpts.HTMLFileName = "MyTest.html";
crResults.ExportOptions.FormatOptions = htmlOpts;
crResults.ExportOptions.ExportFormatType = ExportFormatType.HTML40;
crResults.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
// This line appears to be optional since I've declared a path above:
diskOpts.DiskFileName = @"C:\Temp\MyTest.html";

crResults.ExportOptions.DestinationOptions = diskOpts;
crResults.Export();

My file ends up in a strangely named temp folder (for example, temp_187cb3f0-60bf-4ea7-a0f7-651a1bb0feb3) which gets created in C:\Temp.  Also, it ends up having a .htm extension instead of .html.  How can I avoid having this extra folder created, and how can I get the correct extension?  Any help is appreciated!

Thanks, LRA

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi,

    I too facing same issue, could you please let me know, if u already got ans for this..

    Regards,
    Prasanth
    0