[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.HtmlSaveOptions

HtmlSaveOptions Class

Represents options for saving a workbook as an HTML file.

Use this class to configure HTML export settings such as CSS export behavior, image embedding, sheet and heading output, encoding, tooltip generation, and other HTML-specific save behaviors.

Inheritance
HtmlSaveOptions
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public class HtmlSaveOptions : SaveOptionsBase
Public Class HtmlSaveOptions
    Inherits SaveOptionsBase
Examples
worksheet.Range["A1:D4"].Value = new object[,]
{
    { "Name", "Q1", "Q2", "Q3" },
    { "North", 12, 15, 18 },
    { "South", 8, 11, 13 },
    { "West", 10, 14, 16 }
};
worksheet.Name = "QuarterlyReport";
HtmlSaveOptions options = new HtmlSaveOptions();
options.ExportHeadings = true;
options.ExportGridlines = true;
options.ExportArea = "A1:D4";
options.ExportSheetName = "QuarterlyReport";
using MemoryStream stream = new MemoryStream();
workbook.Save(stream, options);

Constructors

Name Description
HtmlSaveOptions()

Creates options for saving a workbook as an HTML file.

This constructor initializes a new HtmlSaveOptions instance and sets its file format to Html. Use the created object to configure HTML-specific export settings before saving.

Properties

Name Description
AddTooltipText

Gets or sets whether tooltip text is added when data cannot be fully displayed in the exported HTML.

The default value is false.

AttachedFilesUrlPrefix

Gets or sets the URL prefix of attached files, such as images, in the HTML file.

CellAttributeOptions

Specify the options for cell element attributes when exporting to HTML.

CellCssPrefix

Gets or sets the prefix of the CSS class names used in exported HTML.

The default value is null.

CssExportType

Gets or sets the way in which the stylesheet (CSS) is exported.

Encoding

Gets or sets the encoding used when exporting to HTML.

If no encoding has been set, the default value is UTF-8.

ExportArea

Gets or sets which area is exported to HTML.

This property is used for exporting a specific area of a worksheet and takes effect only when ExportSheetName is not null.

ExportCssSeparately

Gets or sets whether the worksheet style is exported to CSS separately.

The default value is true. When this property is false, CSS style data is exported directly to each worksheet and a separate stylesheet.css file is not created.

ExportDocumentProperties

Gets or sets whether document properties are exported when saving to HTML.

This option controls whether the workbook's document properties are included in the generated HTML output. The default value is true.

ExportFileName

Gets or sets the name of the HTML file.

This property is used only when saving to an HTML stream. The default value is "workbook".

ExportGridlines

Gets or sets whether gridlines are exported when saving to HTML.

The default value is false.

ExportHeadings

Gets or sets whether headings are exported when saving a file to HTML.

This property controls whether row and column headings are included in the exported HTML output. The default value is false.

ExportHiddenWorksheet

Gets or sets whether hidden worksheets are exported when saving to HTML.

The default value is false.

ExportImageAsBase64

Gets or sets whether images are saved in Base64 format to HTML.

The default value is false. When this property is true, image data is exported directly on the img elements and separate files are not created.

ExportSheetName

Gets or sets which worksheet is exported to HTML.

This property is used for exporting a specific worksheet of the workbook.

ExportSingleTab

Gets or sets whether a single HTML tab is exported when the workbook contains only one worksheet or when ExportSheetName specifies a worksheet to export.

The default value is false.

IncludeAutoMergedCells

Gets or sets whether automatically merged cells are included when exporting to HTML.

The default value is false.

IsExportComments

Gets or sets whether comments are exported when saving to HTML.

This option applies to HTML export and determines whether cell comments are included in the generated HTML output. The default value is false.

Gets or sets whether full path links are used in exported HTML.

This property applies only when exporting to an HTML file. The default value is false.

IsWidthScalable

Gets or sets whether scalable units are used to describe column widths when exporting to HTML.

This option controls how column width information is written during HTML export. The default value is false.

LinkTargetType

Gets or sets the target attribute type for hyperlinks in exported HTML.

The default value is Blank. Use this property to control how generated links are opened in the target environment, such as in the same frame, parent frame, or a new window or tab.

PageTitle

Gets or sets the title of the HTML page.

TableCssId

Gets or sets the prefix of the type CSS names, such as tr and td, that are contained in the table element with the specific TableCssId attribute.

The default value is null.