Free Support Forum - aspose.com

How to calculate the sum of two fields (of the same data source) with Smart Marker?

Hi,


I have a question on how to evaluate a formula (which takes fields in passed-in data source) with WorkbookDesigner.Process() function .

For example, I set data source of a WorkbookDesigner, then proess it:

designer.SetDataSource(data.getInternalDataSet());
designer.Process();

If I set a smart marker such as “&=FieldName01” to a column before process, then this column show all record’s FieldName01 field in the data source.

But if I want the column to show the sum of two fields, a smart marker such as “&=FieldName01 + &=FieldName02” doesn’t work. Does Aspose.Cells support such functionality?

Hi,


I think you may place a dynamic formula (Smart Markers) in the column and write your markers in the way, e.g
A B C
&=Table1.Field1 &=Table1.Field2 &=&=A{r}+B{r}

The third column marker would process and calculate the sum of each row value of A and B columns respectively.

See the document for your reference:
http://www.aspose.com/docs/display/cellsnet/Smart+Markers

Thank you.