Does any way to add formula into table using aspose word java API. I writen a code to generate aggregate row but I search related for formula content control.
I found API FieldFormula, this field API. Can we add field into Cell?
private void prepareAggregateRow(Table table, Row headerRow, Map<String, WsAttribute> attrValueMap, List<Attribute> attrDefs) throws Exception{
Row totalRow = (Row)headerRow.deepClone(true);
for (Attribute attribute : attrDefs) {
WsAttribute wsAttribute = attrValueMap.get(attribute.getName());
Cell cell = totalRow.getCells().get(attribute.getIdx());
Run run = (Run)cell.getChild(NodeType.RUN, 0,true);
if(wsAttribute!=null && wsAttribute.getValue()!=null) {
run.setText(wsAttribute.getValue());
} else {
run.setText("");
}
}
table.appendChild(totalRow);
}