Free Support Forum - aspose.com

After calling CalulateFormula- new shared formulas don't evaluate

Hello,

We are using Aspose.Cells v4.8.0.15. One problem we noticed is that some cells with formulas do not have values even after calculating. It appears that this happens when the grid has already been calculated before the formula is added to the grid. So the following code, for example, works when the first CalculateFormula is omitted, but when it is put in, the test cell gives "Cell contains no data." even though the formula is there.

This is a big problem for us. Can you suggest anything?

Mishelle

------

public void SetSharedFormulaTest()
{
var workbook = new Workbook();

var grid = workbook.Worksheets[0];
var cell = grid.Cells[0, 2];

cell.Formula = "=3-2";
grid.Workbook.CalculateFormula(false);

cell.SetSharedFormula(cell.Formula, 13, 1);

grid.Workbook.CalculateFormula(false);

Assert.AreEqual(grid.Cells[12, 2].FloatValue, 1);

}

Hi Mishelle,

After an initial test using your sample code, I have found the issue. We will figure it out soon.
Your issue has been logged into our internal issue tracking system with an issue id: CELLSNET-11991. We will let you know when it is resolved.

Thank you.

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issue regarding CalculateFormula.

Thank You & Best Regards,

Thanks, that seems to fix the problem. However, there's another similar problem when using Copy to copy cells with formulas. In the following test, when I use SetSharedFormula to copy the formula to cell [12,7], it works. When I use Copy, I can see that the formula is there but the value is null.


public void SetSharedFormulaTest()
{
var workbook = new Workbook();

var grid = workbook.Worksheets[0];
var cell1 = grid.Cells[0, 2];
var cell2 = grid.Cells[0, 7];

cell1.Formula = "=3-2";
grid.Workbook.CalculateFormula(false);

cell2.Formula = "=SUM(C1:G1)";
grid.Workbook.CalculateFormula(false);

cell1.SetSharedFormula(cell1.Formula, 13, 5);

grid.Cells[12, 7].Copy(cell2);
//cell2.SetSharedFormula(cell2.Formula, 13, 1);

grid.Workbook.CalculateFormula(false);

Assert.AreEqual(grid.Cells[12, 7].FloatValue, 5, "Copied Sum formula is incorrect");
}

Hi,

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon. Your issue has been registered in our issue tracking system with issue id CELLSNET-12254.

Thank You & Best Regards,

Hi,

Please try the attached version, your issue is resolved now.

Thank you.

The issues you have found earlier (filed as 11991) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.