We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problems with formula in GridWeb

Hi,

I run into problems with formula in GridWeb.
1. B8 will not auto calculate in browser:
//set B8 = B6+B7
gridCells.get(“B6”).putValue(12);
gridCells.get(“B7”).putValue(15);
gridCell = gridCells.get(“B8”);
gridCell.setFormula(“B6+B7”);
when IE(or Chrome) open the jsp, value in B6 was 12, and value in B7 was 15, but value in B8 is empty. After I changed the value in B6, the value in B8 changed automatically.

2. When I put value in B8, it seemed that the formula didn’t work:
//set B8 = B6+B7
gridCells.get(“B6”).putValue(12);
gridCells.get(“B7”).putValue(15);
gridCell = gridCells.get(“B8”);
gridCell.setFormula(“B6+B7”);
gridCell.putValue(27);
When IE(or Chrome) open the jsp, value in B6 was 12, and value in B7 was 15, and the value in B8 is 27. But after I changed the value in B6, the value in B8 didn’t changed.

Was there something wrong? please help me out, thanks a lot!

Hi Arnold,

Thanks for your posting and using Aspose.Cells for GridWeb.

Please change your following line of code

gridCell.setFormula(“B6+B7”);

into

gridCell.setFormula("=B6+B7");

It should fix your issue. Please see the equal sign highlighted in red.

Hi mshakeel.faiz,

I added “=” as you told me into the code, but it behaved as before. Sorry about that…
Is there any method that can tell gridweb to recaculate the formulas and refresh the values of the cells? Or maybe you have some better ways to solve this problem?

Hi Arnold,

Thanks for your posting and using Aspose.Cells for GridWeb.

In .NET version, there was RecalculateFormulas() method which I could not find it in Java version.

Kindly provide your sample code in the form of WAR file so that we could investigate this issue further.