GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    HtmlLoadOptions Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents options for loading from HyperText Markup Language File (HTML) format.

    • C#
    • VB.NET
    public sealed class HtmlLoadOptions : LoadOptions
    Public NotInheritable Class HtmlLoadOptions
        Inherits LoadOptions
    Inheritance:
    System.Object
    LoadOptions
    HtmlLoadOptions
    Remarks

    When importing, each paragraph will be translated to spreadsheet row. Text values will be merged in spreadsheet cell. Table rows and cells will be translated to spreadsheet rows and cells. All content inside table cell will be merged in spreadsheet cell, even nested tables and paragraphs.

    Constructors

    HtmlLoadOptions()

    Initializes a new instance of the HtmlLoadOptions class.

    • C#
    • VB.NET
    public HtmlLoadOptions()
    Public Sub New

    Properties

    DateTimeFormats

    Gets or sets an list of formats to be used when parsing cell values to System.DateTime (provided that ParseDates is true).

    • C#
    • VB.NET
    public IList<string> DateTimeFormats { get; set; }
    Public Property DateTimeFormats As IList(Of String)
    Property Value
    System.Collections.Generic.IList<System.String>
    Remarks

    If this list is empty and ParseDates is set to true, texts will be converted to System.DateTime values when they are in one of the default formats supported by System.DateTime.TryParse(System.String,System.IFormatProvider,System.Globalization.DateTimeStyles,System.DateTime@).

    By default, this list is pre-filled with the following formats:

    "d-M-yyyy""d-M-yyyy HH:mm""d-M-yyyy HH:mm:ss"
    "dd-MM-yyyy""dd-MM-yyyy HH:mm""dd-MM-yyyy HH:mm:ss"
    "M-d-yyyy""M-d-yyyy HH:mm""M-d-yyyy HH:mm:ss"
    "MM-dd-yyyy""MM-dd-yyyy HH:mm""MM-dd-yyyy HH:mm:ss"
    "yyyy-M-d""yyyy-M-d HH:mm""yyyy-M-d HH:mm:ss"
    "yyyy-MM-dd""yyyy-MM-dd HH:mm""yyyy-MM-dd HH:mm:ss"
    "d/M/yyyy""d/M/yyyy HH:mm""d/M/yyyy HH:mm:ss"
    "dd/MM/yyyy""dd/MM/yyyy HH:mm""dd/MM/yyyy HH:mm:ss"
    "M/d/yyyy""M/d/yyyy HH:mm""M/d/yyyy HH:mm:ss"
    "MM/dd/yyyy""MM/dd/yyyy HH:mm""MM/dd/yyyy HH:mm:ss"
    "yyyy/M/d""yyyy/M/d HH:mm""yyyy/M/d HH:mm:ss"
    "yyyy/MM/dd""yyyy/MM/dd HH:mm""yyyy/MM/dd HH:mm:ss"

    DateTimeStyles

    Gets or sets a value indicating DateTime styles permitted in strings when parsing them to DateTimes. Default value is System.Globalization.DateTimeStyles.None.

    • C#
    • VB.NET
    public DateTimeStyles DateTimeStyles { get; set; }
    Public Property DateTimeStyles As DateTimeStyles
    Property Value
    System.Globalization.DateTimeStyles

    Encoding

    Gets or sets the encoding for the HTML file.

    • C#
    • VB.NET
    public Encoding Encoding { get; set; }
    Public Property Encoding As Encoding
    Property Value
    System.Text.Encoding
    Exceptions
    System.ArgumentNullException

    Value is set to null.

    HasFormulas

    Gets or sets a value indicating the text is formula if it starts with '='. Default value is false.

    • C#
    • VB.NET
    public bool HasFormulas { get; set; }
    Public Property HasFormulas As Boolean
    Property Value
    System.Boolean

    InheritCellStyle

    Gets or sets a value indicating whether the style should be inherited from the cell where the HTML is being inserted.

    The default value is false.

    • C#
    • VB.NET
    public bool InheritCellStyle { get; set; }
    Public Property InheritCellStyle As Boolean
    Property Value
    System.Boolean
    Remarks

    This property is used only when loading HTML with ExcelCell.SetValue(String, HtmlLoadOptions) method and is ignored when loading the whole HTML file using ExcelFile.Load(String) methods.

    NumberStyles

    Gets or sets a value indicating number styles permitted in strings when parsing them to numeric types.

    • C#
    • VB.NET
    public NumberStyles NumberStyles { get; set; }
    Public Property NumberStyles As NumberStyles
    Property Value
    System.Globalization.NumberStyles

    ParseDates

    Gets or sets a value indicating whether dates will be parsed and stored as System.DateTime values when loading a CSV file. If false, numbers will be loaded as strings. Default value is true.

    • C#
    • VB.NET
    public bool ParseDates { get; set; }
    Public Property ParseDates As Boolean
    Property Value
    System.Boolean

    ParseFormatProvider

    Gets or sets the format provider for the HTML file.

    • C#
    • VB.NET
    public IFormatProvider ParseFormatProvider { get; set; }
    Public Property ParseFormatProvider As IFormatProvider
    Property Value
    System.IFormatProvider
    Exceptions
    System.ArgumentNullException

    Value is set to null.

    ParseNumbers

    Gets or sets a value indicating whether numbers will be parsed and stored as System.Double value when loading HTML file. If false, numbers will be loaded as strings.

    • C#
    • VB.NET
    public bool ParseNumbers { get; set; }
    Public Property ParseNumbers As Boolean
    Property Value
    System.Boolean

    Inherited Properties

    CsvDefault

    Gets the default options for loading from Character Separated Values file format.

    (Inherited from LoadOptions)

    HtmlDefault

    Gets the default options for loading from HyperText Markup Language File (HTML) format.

    (Inherited from LoadOptions)

    OdsDefault

    Gets the default options for loading from OpenDocument Spreadsheet file format.

    (Inherited from LoadOptions)

    TxtDefault

    Gets the default options for loading from Tab delimited file format.

    (Inherited from LoadOptions)

    XlsDefault

    Gets the default options for loading from XLS file format (Microsoft Excel Spreadsheet format; Excel 2003 and prior versions) .

    (Inherited from LoadOptions)

    XlsbDefault

    Gets the default options for loading from XLSX file format (Microsoft Excel Binary File Format).

    (Inherited from LoadOptions)

    XlsxDefault

    Gets the default options for loading from XLSX file format (Microsoft Excel Open XML Spreadsheet; Excel 2007 and later).

    (Inherited from LoadOptions)

    XmlDefault

    Gets the default options for loading from XML file format (XML Spreadsheet 2003).

    (Inherited from LoadOptions)

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.