ExcelFile.SetCellFromString Method
Overloads
- ExcelFile.SetCellFromString(Int32, Int32, String)
- ExcelFile.SetCellFromString(Int32, Int32, TRichString)
- ExcelFile.SetCellFromString(String, String, String[])
- ExcelFile.SetCellFromString(Int32, Int32, String, String[])
- ExcelFile.SetCellFromString(Int32, Int32, TRichString, String[])
- ExcelFile.SetCellFromString(Int32, Int32, String, Int32)
- ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32)
- ExcelFile.SetCellFromString(Int32, Int32, String, Int32, String[])
- ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32, String[])
- ExcelFile.SetCellFromString(Int32, Int32, Int32, TRichString, Int32, String[])
ExcelFile.SetCellFromString(Int32, Int32, String)
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, String value)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | String | Value to enter into the cell. |
See also
ExcelFile.SetCellFromString(Int32, Int32, TRichString)
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, TRichString value)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | TRichString | Value to enter into the cell. |
See also
ExcelFile.SetCellFromString(String, String, String[])
Converts a string into the best datatype (a boolean, a number, etc)
Remarks
See SetCellFromString(Int32, Int32, TRichString, Int32) for more information.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(String cellRef, String value, String[] dateFormats)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
cellRef | String | Cell reference in A1 notation. Something like A3, or Sheet1!$B$5 can be used here. | |
value | String | RichString to convert. | |
dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. |
See also
ExcelFile.SetCellFromString(Int32, Int32, String, String[])
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, String value, String[] dateFormats)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | String | Value to enter into the cell. | |
dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. |
See also
ExcelFile.SetCellFromString(Int32, Int32, TRichString, String[])
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, TRichString value, String[] dateFormats)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | TRichString | Value to enter into the cell. | |
dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. |
See also
ExcelFile.SetCellFromString(Int32, Int32, String, Int32)
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, String value, Int32 XF)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | String | Value to enter into the cell. | |
XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF. |
See also
ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32)
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, TRichString value, Int32 XF)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | TRichString | Value to enter into the cell. | |
XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF. |
See also
ExcelFile.SetCellFromString(Int32, Int32, String, Int32, String[])
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, String value, Int32 XF, String[] dateFormats)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | String | Value to enter into the cell. | |
XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF. | |
dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. |
See also
ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32, String[])
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellFromString(Int32 row, Int32 col, TRichString value, Int32 XF, String[] dateFormats)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | TRichString | Value to enter into the cell. | |
XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF. | |
dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. |
See also
ExcelFile.SetCellFromString(Int32, Int32, Int32, TRichString, Int32, String[])
Converts a string to the best datatype, and the enters it into a cell.
Remarks
When using SetCellValue(Int32, Int32, Object) to set a cell value, you have to know the datatype you want to enter. That is, if you have a string s = "1/1/2002" and call SetCellValue(1, 1, s); the cell A1 will end up with a string "1/1/2002" and not with a date. The same if you have a string holding a number.
SetCellFromString tries to solve this problem. When you call SetCellFromString(1, 1, s) it will look:
- If s contains a valid number: If it does, it will enter the number into the cell, and not the string s
- If s contains a boolean: If s equals the words "TRUE" or "FALSE" (or whatever you define on the constants TxtTrue and TxtFalse) it will enter the boolean into the cell
- If s contains a date: If s is a valid date (according to your windows settings, or with a list of allowed date/time formats) it will enter a number into the cell and format the cell as a date. (see 'Date cells' in the Api Developer Guide)
- In any other case, it will enter the string s into the cell.
Syntax
Namespace: FlexCel.Core
public abstract void SetCellFromString(Int32 sheet, Int32 row, Int32 col, TRichString value, Int32 XF, String[] dateFormats)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
sheet | Int32 | Sheet where the cell is (1 based) | |
row | Int32 | Cell Row (1 based) | |
col | Int32 | Cell Column (1 based) | |
value | TRichString | Value to enter into the cell. | |
XF | Int32 | New XF of the cell. It can be modified, i.e. if you enter a date, the XF will be converted to a Date XF. | |
dateFormats | String[] | A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values. |