ReportDocument.ExportToDisk() exporting file as .html instead of .htm

1k Views Asked by At

I have code like this:

        if (ExportFormat == ExportFormatType.HTML32 || ExportFormat == ExportFormatType.HTML40)
        {
            string filename = Path.Combine("C:\exampleFile.htm"));
            _myReport.ExportToDisk(ExportFormat, filename);
        }

However, for some strange reason, the file is always exported as .html instead of .htm even though I specified for .htm. Anyone know what causes this? I looked online but couldn't find anything about this.

Thanks!

1

There are 1 best solutions below

0
campagnolo_1 On

Why don't you try a little different syntax? Obviously your condition in line 1 doesn't evaluate correctly. So try different variations and find out why it doesn't evaluate.

if (ExportFormat <> ExportFormatType.HTML32)
{
ExportFormat == ExportFormatType.HTML40;
string filename = Path.Combine("C:\exampleFile.htm"));
_myReport.ExportToDisk(ExportFormat, filename);
}