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

    Show / Hide Table of Contents

    CsvSaveOptions Class

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

    Represents options for saving to Character Separated Values file format.

    • C#
    • VB.NET
    public sealed class CsvSaveOptions : SaveOptions
    Public NotInheritable Class CsvSaveOptions
        Inherits SaveOptions
    Inheritance:
    System.Object
    SaveOptions
    CsvSaveOptions

    Constructors

    CsvSaveOptions(CsvType)

    Initializes a new instance of the CsvSaveOptions class.

    • C#
    • VB.NET
    public CsvSaveOptions(CsvType csvType)
    Public Sub New(csvType As CsvType)
    Parameters
    csvType
    CsvType

    Value delimiter, CsvType.

    CsvSaveOptions(Char)

    Initializes a new instance of the CsvSaveOptions class.

    • C#
    • VB.NET
    public CsvSaveOptions(char separator)
    Public Sub New(separator As Char)
    Parameters
    separator
    System.Char

    Character that will serve as value delimiter.

    Properties

    ContentType

    Gets the content-type for CSV file format:

    • "text/tab-separated-values; charset=" + Encoding.System.Text.Encoding.WebName if Type is TabDelimited, otherwise
    • "text/csv; charset=" + Encoding.System.Text.Encoding.WebName.
    • C#
    • VB.NET
    public override string ContentType { get; }
    Public Overrides ReadOnly Property ContentType As String
    Property Value
    System.String

    The content-type for CSV file format.

    Overrides
    SaveOptions.ContentType

    Encoding

    Gets or sets the encoding for the CSV 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.

    FormatProvider

    Gets or sets the format provider for the CSV file.

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

    Value is set to null.

    Limitations

    Gets limitations for saving to CSV file format.

    • C#
    • VB.NET
    public override FileFormatLimitations Limitations { get; }
    Public Overrides ReadOnly Property Limitations As FileFormatLimitations
    Property Value
    FileFormatLimitations
    Overrides
    SaveOptions.Limitations
    Remarks

    These are the limits:

    • MaxRows: System.Int32.MaxValue
    • MaxColumns: System.Int32.MaxValue
    • MaxColors: System.Int32.MaxValue
    • MaxCellStyles: System.Int32.MaxValue

    QuoteMode

    Gets or sets a value indicating in which conditions values in a CSV file should be quoted. Default value is Default.

    • C#
    • VB.NET
    public CsvQuoteMode QuoteMode { get; set; }
    Public Property QuoteMode As CsvQuoteMode
    Property Value
    CsvQuoteMode

    Separator

    Gets or sets character that serves as value delimiter.

    • C#
    • VB.NET
    public char Separator { get; set; }
    Public Property Separator As Char
    Property Value
    System.Char
    Exceptions
    System.ArgumentException

    Value is set to quote '"' or new line '\n'.

    Type

    Gets or sets value delimiter type, see CsvType.

    • C#
    • VB.NET
    public CsvType? Type { get; set; }
    Public Property Type As CsvType?
    Property Value
    System.Nullable<CsvType>
    Exceptions
    System.ArgumentNullException

    Value is set to null.

    UseFormattedValues

    Gets or sets a value indicating whether values in CSV file will be formatted using NumberFormat. Default value is false.

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

    Inherited Properties

    CsvDefault

    Gets the default options for saving to Character Separated Values file format.

    (Inherited from SaveOptions)

    HtmlDefault

    Gets the default options for saving to HyperText Markup Language File format.

    (Inherited from SaveOptions)

    ImageDefault

    Gets the default options for saving to image formats.

    (Inherited from SaveOptions)

    OdsDefault

    Gets the default options for saving to OpenDocument Spreadsheet file format.

    (Inherited from SaveOptions)

    PdfDefault

    Gets the default options for saving to Portable Document Format file.

    (Inherited from SaveOptions)

    TxtDefault

    Gets the default options for saving to Tab delimited file format.

    (Inherited from SaveOptions)

    XlsDefault

    Gets the default options for saving to, XLS file format (Microsoft Excel Spreadsheet format; Excel 2003 and prior versions) .

    (Inherited from SaveOptions)

    XlsbDefault

    Gets the default options for saving to XLSB file format (Microsoft Excel Binary File Format).

    (Inherited from SaveOptions)

    XlsxDefault

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

    (Inherited from SaveOptions)

    XpsDefault

    Gets the default options for saving to XML Paper Specification file format.

    (Inherited from SaveOptions)

    Examples

    Create and write Excel file in C# and VB.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.