将 Excel 转换为带标题的 HTML
Contents
[
Hide
]
将 Excel 转换为带标题的 HTML
Aspose.Cells 提供了在将 Excel 转换为 HTML 时导出标题的选项。为此,您可以设置HtmlSaveOptions.ExportHeadings财产给真的.默认值HtmlSaveOptions.ExportHeadings财产是错误的.下图显示了以下代码生成的输出文件。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load sample source file | |
Workbook workbook = new Workbook(sourceDir + "Book1.xlsx"); | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.ExportRowColumnHeadings = true; | |
// Save the workbook | |
workbook.Save(outputDir + "PrintHeadings_out.html", options); |