Class ExportTableOptions

Class ExportTableOptions

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Represents all export table options.

public class ExportTableOptions

Inheritance

objectExportTableOptions

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

If there are some special requirements about the exporting, such as ignoring error values, user may extend this class to overwrite corresponding apis to achive the goal.

Constructors

ExportTableOptions()

public ExportTableOptions()

Properties

AllowDBNull

This value indicates whether DBNulls are allowed in this table.

public bool AllowDBNull { get; set; }

Property Value

bool

CheckMixedValueType

False, Aspose.Cells will set the DataColumn’s type by the value type of the first row for performance. True, Aspose.Cells will check whether the value type in the column are mixed before set the DataColumn’s type And the value type are mixed, the DataColumn’s type will be string.

public bool CheckMixedValueType { get; set; }

Property Value

bool

DataTable

Gets and sets the DataTable which columns’ data type is assigned.

public DataTable DataTable { get; set; }

Property Value

DataTable

ExportAsHtmlString

Exports the html string value of the cells to the DataTable.

public bool ExportAsHtmlString { get; set; }

Property Value

bool

ExportAsString

Exports the string value of the cells to the DataTable.

public bool ExportAsString { get; set; }

Property Value

bool

ExportColumnName

Indicates whether the data in the first row are exported to the column name of the DataTable. The default value is false.

public bool ExportColumnName { get; set; }

Property Value

bool

FormatStrategy

Gets and sets the format strategy when exporting the value as string value.

public CellValueFormatStrategy FormatStrategy { get; set; }

Property Value

CellValueFormatStrategy

Indexes

The indexes of columns/rows which should be exported out.

public int[] Indexes { get; set; }

Property Value

int[]

IsVertical

True if a row in Workbook file represents a row in DataTable. False if a column in Workbook file represents a row in DataTable.

public bool IsVertical { get; set; }

Property Value

bool

PlotVisibleCells

Only exports visible cells.

public bool PlotVisibleCells { get; set; }

Property Value

bool

PlotVisibleColumns

Only exports visible columns.

public bool PlotVisibleColumns { get; set; }

Property Value

bool

PlotVisibleRows

Only exports visible rows.

public bool PlotVisibleRows { get; set; }

Property Value

bool

RenameStrategy

Strategy for duplicate names of columns.

public RenameStrategy RenameStrategy { get; set; }

Property Value

RenameStrategy

SkipErrorValue

Indicates whether skip invalid value for the column. For example,if the column type is decimal ,the value is greater than decimal.MaxValue and this property is true,we will not throw exception again. The default value is false.

public bool SkipErrorValue { get; set; }

Property Value

bool

Methods

PreprocessExportedValue(int, int, CellValue)

Preprocess the value of current cell to be exported.

public virtual bool PreprocessExportedValue(int cellRow, int cellColumn, CellValue value)

Parameters

cellRow int

the row index of current cell

cellColumn int

the column index of cell

value CellValue

value and type of current cell

Returns

bool

Whether current cell has been replaced with different type and/or value.

Remarks

The row and column index is cell’s absolute index in the worksheet, not index in the exported table. User may check the value of current cell in the override implementation of this method, if current cell needs to be replaced with other type and value, here the implementation should set the expected type and value to the CellValue object and return true. By default this method does nothing and returns false.