Completed
Last Updated: 02 Jul 2020 12:01 by ADMIN
Release R3 2020
ADMIN
Deyan
Created on: 25 Apr 2016 16:51
Category: SpreadProcessing
Type: Bug Report
0
SpreadProcessing: Formulas containing new lines are not parsed correctly
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', ' '));
        }
    }
}
1 comment
ADMIN
Peshito
Posted on: 02 Jul 2020 12:01

Hello,

This item will be available in R3 2020 Release. 

 

It is also available with Telerik UI for WPF's latest internal build - LIB 2020.2.706 (07/06/2020) if you need it earlier.

 

Regards,
Peshito
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.