0

我有这样的代码:

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

但是,出于某种奇怪的原因,即使我指定了 .htm,文件也总是导出为 .html 而不是 .htm。有谁知道这是什么原因?我在网上查看,但找不到任何关于此的信息。

谢谢!

4

1 回答 1

0

你为什么不尝试一些不同的语法?显然,您在第 1 行中的条件评估不正确。所以尝试不同的变化,找出为什么它不评估。

if (ExportFormat <> ExportFormatType.HTML32)
{
ExportFormat == ExportFormatType.HTML40;
string filename = Path.Combine("C:\exampleFile.htm"));
_myReport.ExportToDisk(ExportFormat, filename);
}
于 2013-12-09T14:38:21.830 回答