XlsFile.GetStringFromCell Method
This method will return a rich string that is formatted similar to the way Excel shows it. For example, if you have "1.0" on a cell, and the cell is formatted as exponential, this method will return "1.0e+1" It might also change the color depending on the value and format. (for example, red for negative numbers) Conditional formats are not applied, you need to call ExcelFile.ConditionallyModifyFormat(TFlxFormat, Int32, Int32, Boolean, TDrawingConditionalFormat) to the cell style for that.
Syntax
Namespace: FlexCel.XlsAdapter
public override TRichString GetStringFromCell(Int32 sheet, Int32 row, Int32 col, ref Int32 XF, ref TUIColor aColor, Boolean ignorePrintErrors)
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) | |
ref | XF | Int32 | The resulting XF for the cell. |
ref | aColor | TUIColor | Resulting color of the string. If for example you define red for negative numbers, and the result is red, this will be returned on aColor. If there is not color info on the format, it will remain unchanged. |
ignorePrintErrors | Boolean | If true, the string for an error like #DIV/0 will always by #DIV/0 instead of using the value of ExcelFile.PrintErrors. Set it to true when the value is not for printing it. |
Returns
A rich string with the cell value.