HotXLS 文档

SaveAsHTML 方法

Saves Worksheet in HTML file. Returns 1 if it succeeds

备注

This method is deprecated. Use TXLSWorksheet.SaveAs method
导出单元格中的超链接会写成 HTML 锚点标签。超链接地址以 href, ScreenTip text is emitted as a title attribute, and all attribute and display text is HTML-escaped
Cell comments are emitted as escaped title 属性形式保留在导出的表格单元格上,审阅备注因此在生成的 HTML 中仍可作为浏览器提示查看
To customize exporter behavior, create TXLSHTMLExport directly. Its Options property defaults to [xhHyperlinks, xhComments]; remove xhHyperlinks to write linked cells as plain escaped text, or remove xhComments to suppress comment title output Set Title to write an escaped HTML document <title> value. Set SimpleExport 来写出最简表格:不带生成的 CSS 类、超链接锚点或批注 title 属性。使用 TableBorderWidth, CellPadding, and CellSpacing to control the generated table layout attributes

语法

function SaveAsHTML(FileName: WideString): Integer;
FileName WideString。指示要保存文件名的字符串。可以包含完整路径;若不包含,工作表会把文件保存到当前文件夹

示例

This example creates a new workheet and then saves it in the HTML file

Var
  Workbook: IXLSWorkbook;
  Worksheet: TXLSWorksheet;
begin
  Workbook := TXLSWorkbook.Create; {create new Workbook}
  Worksheet := Workbook.Worksheets.Add;
  {....}
  Worksheet.SaveAsHTML('C:\sheet.html');
end;