TTMSFNCGridExcelExport.ExportHtml Method
Overloads
- TTMSFNCGridExcelExport.ExportHtml(TFileName, THtmlExportMode)
- TTMSFNCGridExcelExport.ExportHtml(TFlexCelHtmlExport, string, THtmlExportMode)
TTMSFNCGridExcelExport.ExportHtml(TFileName, THtmlExportMode)
Exports the attached grid to HTML.
Remarks
This method will export to HTML with the standard defaults. If you want to customized the export more you can use ExportHtml(TFlexCelHtmlExport, string, THtmlExportMode) instead.
Syntax
Unit: VCL.TMSFNCGridExcelExport / FMX.TMSFNCGridExcelExport
procedure TTMSFNCGridExcelExport.ExportHtml(const aFileName: TFileName; const aExportMode: THtmlExportMode); overload;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | aFileName | TFileName | Filename of the generated file. All extra files like images will be stored in the same folder. |
const | aExportMode | THtmlExportMode |
See also
TTMSFNCGridExcelExport.ExportHtml(TFlexCelHtmlExport, string, THtmlExportMode)
Exports the attached grid to HTML. As this method uses a TFlexCelHtmlExport class to do the export, you can customize all options in the html exporting before calling this method.
Remarks
This method will export to HTML with the standard xls file defaults. If you want to customized the export more you can use ExportHtml(TFlexCelHtmlExport, string, THtmlExportMode) instead.
Syntax
Unit: VCL.TMSFNCGridExcelExport / FMX.TMSFNCGridExcelExport
procedure TTMSFNCGridExcelExport.ExportHtml(const aHtml: TFlexCelHtmlExport; const aFileName: string; const aExportMode: THtmlExportMode); overload;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | aHtml | TFlexCelHtmlExport | This is a TFlexCelHtmlExport component that you need to create. |
const | aFileName | string | Filename of the generated file. All extra files like images will be stored in the same folder. |
const | aExportMode | THtmlExportMode | How the grid will be exported. |
Examples
To export the grid to HTML, customizing the HTML output, you can use the code:
uses ..., FlexCel.Core, FlexCel.XlsAdapter, FlexCel.Render;
...
procedure TExampleForm.ExportGridToHtml;
var
html: TFlexCelHtmlExport;
begin
//FlexCelHtmlExport that we will use to do the export.
html := TFlexCelHtmlExport.Create;
try
html.AllowOverwritingFiles := true;
//Here we can customize the HtmlExport
html.HtmlVersion := THtmlVersion.Html_32;
//Export the grid to the stream, using our custom FlexCelHtmlExport.
TMSFNCGridExcelExport1.ExportHtml(html, 'MyFile.html', THtmlExportMode.AllSheetsAsSingleFile);
finally
html.Free;
end;
end;