8using System.Collections.Generic;
9using System.Globalization;
10using NanoXLSX.Exceptions;
11using NanoXLSX.Interfaces.Plugin;
68#pragma warning disable CA1720
97#pragma warning restore CA1720
131 public Dictionary<int, ColumnType>
EnforcedColumnTypes {
get;
private set; } =
new Dictionary<int, ColumnType>();
169 this.EnforcedColumnTypes.Add(Cell.ResolveColumn(columnAddress), type);
179 this.EnforcedColumnTypes.Add(columnNumber, type);
The reader options define global rules, applied when loading a worksheet. The options are mainly to o...
ColumnType
Column types to enforce during the read process. The types are tried to be applied on all cells of a ...
@ String
Cells are all imported as strings, using the ToString() method.
@ Date
Cells are tried to be imported as dates (DateTime). See also DateTimeFormat, TimeSpanFormat and Tempo...
@ Decimal
Cells are tried to be imported as numbers (enforcing decimal).
@ Time
Cells are tried to be imported as times (TimeSpan).
@ Bool
Cells are tried to be imported as bools.
@ Double
Cells are tried to be imported as numbers (enforcing double).
int EnforcingStartRowNumber
The row number (zero-based) where enforcing rules are started to be applied. This is,...
string DateTimeFormat
Format if DateTime values are cast to strings or DateTime objects are parsed from strings....
void AddEnforcedColumn(string columnAddress, ColumnType type)
Adds a type enforcing rule to the passed column address.
Dictionary< int, ColumnType > EnforcedColumnTypes
Type enforcing rules during the read process for particular columns.
void AddEnforcedColumn(int columnNumber, ColumnType type)
Adds a type enforcing rule to the passed column number (zero-based).
bool IgnoreNotSupportedPasswordAlgorithms
If set to true, worksheet or workbook protection passwords with unknown / not supported algorithms wi...
bool EnforceDateTimesAsNumbers
If true, date or time values (default format number 14 or 21) will be interpreted as numeric values g...
static readonly CultureInfo DefaultCultureInfo
Default culture info instance (invariant culture) used for date and time parsing, if no custom cultur...
string TimeSpanFormat
Format if TimeSpan values are cast to strings.
bool EnforcePhoneticCharacterImport
If true, phonetic characters (like ruby characters / Furigana / Zhuyin fuhao) in strings are added in...
GlobalType
Global conversion types to enforce during the load process. All types other than GlobalType....
@ AllNumbersToDouble
All numbers are cast to doubles.
@ AllNumbersToDecimal
All numbers are cast to decimal.
@ Default
No global strategy. All numbers are tried to be cast to the most suitable types.
@ EverythingToString
Every cell is cast to a string.
@ AllNumbersToInt
All numbers are cast to integers. Floating point numbers will be rounded (commercial rounding) to the...
CultureInfo TemporalCultureInfo
Culture info instance, used to parse DateTime or TimeSpan objects from strings. If null,...
GlobalType GlobalEnforcingType
Global strategy to handle cell values. The default will not enforce any general casting,...
bool EnforceStrictValidation
If true, invalid data, like column widths or row height that are out of range, will cause an exceptio...
const string DefaultDateTimeFormat
Default format if DateTime values are cast to strings.
bool EnforceEmptyValuesAsString
If true, empty cells will be interpreted as type of string with an empty value. If false,...
const string DefaultTimeSpanFormat
Default format if TimeSpan values are cast to strings.