Class ExcelHtmlRangeExporter
Exports a ExcelTable to Html
Inherited Members
Namespace: OfficeOpenXml.Export.HtmlExport
Assembly: EPPlus.dll
Syntax
public class ExcelHtmlRangeExporter : HtmlExporterBase
Properties
Ranges
The ranges used in the export.
Declaration
public EPPlusReadOnlyList<ExcelRangeBase> Ranges { get; }
Property Value
Type | Description |
---|---|
EPPlusReadOnlyList<ExcelRangeBase> |
Settings
Setting used for the export.
Declaration
public HtmlRangeExportSettings Settings { get; }
Property Value
Type | Description |
---|---|
HtmlRangeExportSettings |
Methods
GetCssString()
Exports an ExcelTable to a html string
Declaration
public string GetCssString()
Returns
Type | Description |
---|---|
System.String | A html table |
GetCssStringAsync()
Exports an ExcelTable to a html string
Declaration
public async Task<string> GetCssStringAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A html table |
GetHtmlString()
Exports an ExcelTable to a html string
Declaration
public string GetHtmlString()
Returns
Type | Description |
---|---|
System.String | A html table |
GetHtmlString(Int32)
Exports an ExcelTable to a html string
Declaration
public string GetHtmlString(int rangeIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex |
Returns
Type | Description |
---|---|
System.String | A html table |
GetHtmlStringAsync()
Exports an ExcelTable to a html string
Declaration
public async Task<string> GetHtmlStringAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A html table |
GetHtmlStringAsync(Int32)
Exports an ExcelTable to a html string
Declaration
public async Task<string> GetHtmlStringAsync(int rangeIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rangeIndex |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A html table |
GetSinglePage(String)
Renders both the Html and the Css to a single page.
Declaration
public 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}</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
public async 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}</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
public 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 an ExcelTable to html and writes it to a stream
Declaration
public async Task RenderCssAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
RenderHtml(Stream)
Exports an ExcelTable to a html string
Declaration
public void RenderHtml(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
RenderHtml(Stream, Int32)
Exports an ExcelTable to a html string
Declaration
public void RenderHtml(Stream stream, int rangeIndex)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to |
System.Int32 | rangeIndex | The index of the range to output. |
RenderHtmlAsync(Stream)
Exports an ExcelTable to a html string
Declaration
public async 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)
Exports the html part of the html export, without the styles.
Declaration
public async Task RenderHtmlAsync(Stream stream, int rangeIndex)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write the css to. |
System.Int32 | rangeIndex | The index of the range to output. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
System.IO.IOException |