SAP Knowledge Base Article - Public

1796652 - ExportToDisk ExportFormatType.HTML40 & HTML32 results in HTM file extension

Symptom

  • Visual Studio 2010 referencing SAP Crystal Reports for Visual Studio 2010 assemblies
  • Using the following code results in the exported file having an extension of HTM:

Dim HTML32Formatopts As New HTMLFormatOptions()

With crExportOptions
     .ExportDestinationType = ExportDestinationType.DiskFile
     .ExportFormatType = ExportFormatType.HTML32
End With

With HTML32Formatopts
      .HTMLBaseFolderName = ExportPath + "Html32Folder" 'Foldername to place HTML files
      .HTMLFileName = "HTML32.html"
      .HTMLEnableSeparatedPages = False
      .HTMLHasPageNavigator = False
End With

crExportOptions.FormatOptions = HTML32Formatopts

Environment

  • Crystal Reports for Visual Studio 2010
  • Visual Studio 2010

Cause

  • This issue has been submitted for a resolution
  • ADAPT01674853

Resolution

  • A work-around is to rename the exported file using the following code:


    if (format.FormatType == ExportFormatType.HTML32 ||

        format.FormatType == ExportFormatType.HTML40)

          {
                if (File.Exists(fileDlg.FileName))
                {
                      File.Delete(fileDlg.FileName);
                }
               File.Move(Path.ChangeExtension(fileDlg.FileName, ".htm"), fileDlg.FileName);
          }

 

Keywords

KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio