Interface IExcelHtmlRangeExporter
Public interface for the Html exporter
Namespace: OfficeOpenXml.Export.HtmlExport.Interfaces
Assembly: EPPlus.dll
Syntax
public interface IExcelHtmlRangeExporter
Properties
Ranges
Exported ranges
Declaration
EPPlusReadOnlyList<ExcelRangeBase> Ranges { get; }
Property Value
Type | Description |
---|---|
EPPlusReadOnlyList<ExcelRangeBase> |
Settings
Settings for how to perform the html export
Declaration
HtmlRangeExportSettings Settings { get; }
Property Value
Type | Description |
---|---|
HtmlRangeExportSettings |
Methods
GetCssString()
Exports an ExcelTable to a html string
Declaration
string GetCssString()
Returns
Type | Description |
---|---|
System.String | Cascading style sheet for the exported range |
GetCssStringAsync()
Exports the css part of an ExcelTable to a html string
Declaration
Task<string> GetCssStringAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A html table |
GetHtmlString()
Exports an ExcelTable to a html string
Declaration
string GetHtmlString()
Returns
Type | Description |
---|---|
System.String | A html table |
GetHtmlString(Int32)
Exports an ExcelTable to a html string
Declaration
string GetHtmlString(int rangeIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex | 0-based index of the requested range |
Returns
Type | Description |
---|---|
System.String | A html table |
GetHtmlString(Int32, ExcelHtmlOverrideExportSettings)
Exports an ExcelTable to a html string
Declaration
string GetHtmlString(int rangeIndex, ExcelHtmlOverrideExportSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex | Index of the range to export |
ExcelHtmlOverrideExportSettings | settings | Override some of the settings for this html exclusively |
Returns
Type | Description |
---|---|
System.String | A html table |
GetHtmlString(Int32, Action<ExcelHtmlOverrideExportSettings>)
Exports an ExcelTable to a html string
Declaration
string GetHtmlString(int rangeIndex, Action<ExcelHtmlOverrideExportSettings> config)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex | Index of the range to export |
System.Action<ExcelHtmlOverrideExportSettings> | config | Override some of the settings for this html exclusively |
Returns
Type | Description |
---|---|
System.String |
GetHtmlStringAsync()
Exports an ExcelTable to a html string
Declaration
Task<string> GetHtmlStringAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A html table |
GetHtmlStringAsync(Int32, ExcelHtmlOverrideExportSettings)
Exports an ExcelTable to a html string
Declaration
Task<string> GetHtmlStringAsync(int rangeIndex, ExcelHtmlOverrideExportSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex | Index of the range to export |
ExcelHtmlOverrideExportSettings | settings | Override some of the settings for this html exclusively |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A html table |
GetHtmlStringAsync(Int32, Action<ExcelHtmlOverrideExportSettings>)
Exports an ExcelTable to a html string
Declaration
Task<string> GetHtmlStringAsync(int rangeIndex, Action<ExcelHtmlOverrideExportSettings> config)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex | Index of the range to export |
System.Action<ExcelHtmlOverrideExportSettings> | config | Override some of the settings for this html exclusively |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |
GetSinglePage(String)
Renders both the Html and the Css to a single page.
Declaration
string GetSinglePage(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}\r\n</body>\r\n</html>")
Parameters
Type | Name | Description |
---|---|---|
System.String | htmlDocument | The html string where to insert the html and the css. The Html will be inserted in string parameter {0} and the Css will be inserted in parameter {1}. |
Returns
Type | Description |
---|---|
System.String | The html document |
GetSinglePageAsync(String)
Renders the first range of the Html and the Css to a single page.
Declaration
Task<string> GetSinglePageAsync(string htmlDocument = "<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<style type=\"text/css\">\r\n{1}</style></head>\r\n<body>\r\n{0}\r\n</body>\r\n</html>")
Parameters
Type | Name | Description |
---|---|---|
System.String | htmlDocument | The html string where to insert the html and the css. The Html will be inserted in string parameter {0} and the Css will be inserted in parameter {1}. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | The html document |
RenderCss(Stream)
Exports the css part of the html export.
Declaration
void RenderCss(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write the css to. |
Exceptions
Type | Condition |
---|---|
System.IO.IOException |
RenderCssAsync(Stream)
Exports the css part of an ExcelTable to a html string
Declaration
Task RenderCssAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A html table |
RenderHtml(Stream)
Exports an ExcelTable to a html string
Declaration
void RenderHtml(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
RenderHtml(Stream, Int32, ExcelHtmlOverrideExportSettings)
Exports an ExcelTable to a html string
Declaration
void RenderHtml(Stream stream, int rangeIndex, ExcelHtmlOverrideExportSettings overrideSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
System.Int32 | rangeIndex | The index of the range to output. |
ExcelHtmlOverrideExportSettings | overrideSettings | Settings for this specific range index |
RenderHtml(Stream, Int32, Action<ExcelHtmlOverrideExportSettings>)
Exports an ExcelTable to a html string
Declaration
void RenderHtml(Stream stream, int rangeIndex, Action<ExcelHtmlOverrideExportSettings> config)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
System.Int32 | rangeIndex | The index of the range to output. |
System.Action<ExcelHtmlOverrideExportSettings> | config | Settings for this specific range index |
RenderHtmlAsync(Stream)
Exports an ExcelTable to a html string
Declaration
Task RenderHtmlAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A html table |
RenderHtmlAsync(Stream, Int32, ExcelHtmlOverrideExportSettings)
Exports the html part of the html export, without the styles.
Declaration
Task RenderHtmlAsync(Stream stream, int rangeIndex, ExcelHtmlOverrideExportSettings overrideSettings = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to. |
System.Int32 | rangeIndex | The index of the range to output. |
ExcelHtmlOverrideExportSettings | overrideSettings | Settings for this specific range index |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
System.IO.IOException |
RenderHtmlAsync(Stream, Int32, Action<ExcelHtmlOverrideExportSettings>)
Exports the html part of the html export, without the styles.
Declaration
Task RenderHtmlAsync(Stream stream, int rangeIndex, Action<ExcelHtmlOverrideExportSettings> config)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to. |
System.Int32 | rangeIndex | Index of the range to export |
System.Action<ExcelHtmlOverrideExportSettings> | config | Override some of the settings for this html exclusively |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |