Skip to main content

IXlTableColumn.SetFormula(String) Method

Specifies the formula to apply to all cells in the table column.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

void SetFormula(
    string formula
)

Parameters

Name Type Description
formula String

A string that specifies a formula contained in the cells of the table column.

Remarks

Use the SetFormula method to automatically fill the formula in all cells of the table column. A string specified as a formula should conform to the formula syntax rules and contain only supported elements (for example, you cannot use structured references or defined names in your formula).

To provide the capability to parse and validate textual formulas, you should specify a formula parser. To do this, use the XlExport.CreateExporter method with the DevExpress.Spreadsheet.XlFormulaParser class instance passed as the second parameter. If the parser detects any unsupported element in your formula, an exception will be thrown.

Note

The XlFormulaParser class used as a formula parser requires a reference to the DevExpress.Spreadsheet.v24.1.Core.dll assembly. If this assembly is missing, a string formula cannot be parsed. A missing parser does not allow export to the .xls (Excel 97-2003) format and leaves unvalidated formulas in a worksheet exported to the .xlsx (Office Open XML) format.

See Also