# Calculate Formula while Assembling Spreadsheet Documents ## Calculate Formula ### The Recipe * Set up source document template path * Set up destination report path * Instantiate DocumentAssembler class * Set options, **DocumentAssemblyOptions.UPDATE\_FIELDS\_AND\_FORMULAS** * Generate report ### Download Template Get the template from here. * [Update formula.xlsx](https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-Java/blob/master/Examples/GroupDocs.Assembly.Examples.Java/Data/Storage/Spreadsheet%20Templates/Update%20formula.xlsx?raw=true) ### The Code {{< gist GroupDocsGists b6b73ca430d573c372ff100ffab9ebb0 >}}