CalculateFormulas()

IChartDataWorkbook::CalculateFormulas() method

Calculates all formulas in the workbook and updates corresponding cells values.

virtual void Aspose::Slides::Charts::IChartDataWorkbook::CalculateFormulas()=0

Remarks

Example shows how to assign a formula to the cell and to calculate a value. The value of the "B4" cell is getting set to 5.

auto pres = System::MakeObject<Presentation>();

auto chart = pres->get_Slides()->idx_get(0)->get_Shapes()->AddChart(ChartType::Pie, 100.0f, 100.0f, 300.0f, 400.0f);
auto wb = chart->get_ChartData()->get_ChartDataWorkbook();
wb->GetCell(0, u"B2", ObjectExt::Box<int32_t>(2));
wb->GetCell(0, u"B3", ObjectExt::Box<int32_t>(3));
wb->GetCell(0, u"B4")->set_Formula(u"B2+B3");
wb->CalculateFormulas();
//...

See Also