Class HtmlExportSettings
Base class for HTML export for ranges and tables.
Inherited Members
Namespace: OfficeOpenXml.Export.HtmlExport
Assembly: EPPlus.dll
Syntax
public abstract class HtmlExportSettings
Properties
Accessibility
Settings for usage of accessibility (aria, role) attributes of the table
Declaration
public AccessibilitySettings Accessibility { get; }
Property Value
Type | Description |
---|---|
AccessibilitySettings |
AdditionalTableClassNames
Use this property to set additional class names that will be set on the exported html-table.
Declaration
public List<string> AdditionalTableClassNames { get; protected set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
CellStyleClassName
The name of the classes used for cell styles. The name will be prefixed with the StyleClassPrefix and suffixed with the cell style index.
Declaration
public string CellStyleClassName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Culture
The culture used when formatting the cell output.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo |
DataValueAttributeName
Use this property to set the name of the html data-* attribute that contains the raw value. Default value is "value" which means that the name of the attribute is "data-value". To change the name to "data-x", set this property to "x"
Declaration
public string DataValueAttributeName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Encoding
Encoding for the output
Declaration
public Encoding Encoding { get; set; }
Property Value
Type | Description |
---|---|
System.Text.Encoding |
HiddenRows
How hidden rows will be handled. Default is Exclude
Declaration
public eHiddenState HiddenRows { get; set; }
Property Value
Type | Description |
---|---|
eHiddenState |
HorizontalAlignmentWhenGeneral
How to set the alignment for a cell if it's alignment is set to General.
Declaration
public eHtmlGeneralAlignmentHandling HorizontalAlignmentWhenGeneral { get; set; }
Property Value
Type | Description |
---|---|
eHtmlGeneralAlignmentHandling |
HyperlinkTarget
Set the target attribute for hyperlinks (a elements) in the exported html. Can be null/empty (no target attribute), _blank, _top, _self, _parent or a frame-name.
Declaration
public string HyperlinkTarget { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IncludeCssClassNames
If set to true classes that identifies Excel table styling will be included in the html. Default value is true.
Declaration
public bool IncludeCssClassNames { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Minify
If set to true the rendered html will be formatted with indents and linebreaks.
Declaration
public bool Minify { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Pictures
If picture drawings will be included. Default is true.
Declaration
public HtmlPictureSettings Pictures { get; }
Property Value
Type | Description |
---|---|
HtmlPictureSettings |
RenderDataAttributes
If true data-* attributes will be rendered
Declaration
public bool RenderDataAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RenderDataTypes
If true, data types are renedered on the header objects.
Declaration
public bool RenderDataTypes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SetColumnWidth
Set the column width for columns in the table via the columngroup/col element. Columns with the default width will have the default column width class set, ({Settings.StyleClassPrefix}dcw). Columns with custom column width will have the width set directly via the style attribute.
Declaration
public bool SetColumnWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SetRowHeight
Set the row height for rows in the table. Rows with the default height will have the default row height class set, ({Settings.StyleClassPrefix}drh). Rows with custom row height will have the height set directly via the style attribute.
Declaration
public bool SetRowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
StyleClassPrefix
Prefix for style classes added by EPPlus.
type | Class name |
---|---|
Cell styles | {StyleClassPrefix}{CellStyleClassName}{index} |
Hidden Row{StyleClassPrefix}hidden | |
Alignment Left | {StyleClassPrefix}al |
Alignment Right | {StyleClassPrefix}ar |
Default column width | {StyleClassPrefix}dcw |
Default row height | {StyleClassPrefix}drh |
Image content and position | {StyleClassPrefix}image-{imageName} |
Properties for an image, for example position or border settings | {StyleClassPrefix}image-prop-{imageName} |
Alignment for cells containing an image | {StyleClassPrefix}image-cell} |
Declaration
public string StyleClassPrefix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TableId
The html id attribute for the exported table. The id attribute is only added to the table if this property is not null or empty.
Declaration
public string TableId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TableStyle
If and how table styles should export, if the range is a table. The range must be the same as the table range.
Declaration
public eHtmlRangeTableInclude TableStyle { get; set; }
Property Value
Type | Description |
---|---|
eHtmlRangeTableInclude |