To reproduce:
- Add the following formula to a cell: "=A1=FALSE"
Actual: the result is always false
Expected: the result should be true when the cell is empty
Workaround: Use the ISBLANK function.
Handle the case where the formula starts with "=+". Detailed information: https://professor-excel.com/equal-plus-excel-formulas/
Workaround: replace the "=+" with "="
CellRange usedCellRange = workbook.Worksheets[0].UsedCellRange;
for (int rowIndex = usedCellRange.FromIndex.RowIndex; rowIndex <= usedCellRange.ToIndex.RowIndex; rowIndex++)
{
for (int columnIndex = usedCellRange.FromIndex.ColumnIndex; columnIndex <= usedCellRange.ToIndex.ColumnIndex; columnIndex++)
{
CellSelection cell = workbook.Worksheets[0].Cells[rowIndex, columnIndex];
FormulaCellValue formulaCellValue =cell.GetValue().Value as FormulaCellValue;
if (formulaCellValue == null)
{
continue;
}
CellValueFormat format = cell.GetFormat().Value;
string resultValueAsString = formulaCellValue.GetValueAsString(format);
Console.WriteLine(resultValueAsString);
if (resultValueAsString.StartsWith("=+"))
{
resultValueAsString = resultValueAsString.Remove(1, 1);
cell.SetValue(resultValueAsString);
}
}
}
radSpreadsheet.Workbook = workbook;
Hi Telerik,
I would like to request 1 feature to be added in Current RADGRID control which is to exporting grid data to into Excel 2016 version.
We need this feature because one of our supporting application will work only with Excel 2016 version, where as the current RADGRID conversion only able to export to EXCEL 2007 (excel 12) format.
Thank you.
When a formula contains new lines, it is parsed incorrectly as follows: - When it is shared formula it breaks the imported expression and replaces it with #NAME? error. - In normal case it simply preserves the formula string converting it to StringExpression. Workaround: Remove the new lines in the formulas. Have in mind that this code will fix the issue only for the second scenario, when the formula is not shared. CellRange usedCellRange = workbook.ActiveWorksheet.UsedCellRange; for (int row = usedCellRange.FromIndex.RowIndex; row < usedCellRange.ToIndex.RowIndex; row++) { for (int column = usedCellRange.FromIndex.ColumnIndex; column < usedCellRange.ToIndex.ColumnIndex; column++) { CellSelection cell = workbook.ActiveWorksheet.Cells[row, column]; ICellValue value = cell.GetValue().Value; if (value.RawValue.Contains("\n")) { cell.SetValue(value.RawValue.Replace('\n', ' ')); } } }