Calculate Formula while Assembling Spreadsheet Documents
Leave feedback
- Set up source document template path
- Set up destination report path
- Instantiate DocumentAssembler class
- Set options, DocumentAssemblyOptions.UPDATE_FIELDS_AND_FORMULAS
- Generate report
Get the template from here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-Java | |
String srcDocument = "/Spreadsheet Templates/Update formula.xlsx"; | |
String docReport = "/Spreadsheet Reports/Update formula_report.xlsx"; | |
try { | |
Manager manager = new DataStorage().getManagers().iterator().next(); | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.setOptions(DocumentAssemblyOptions.UPDATE_FIELDS_AND_FORMULAS); | |
assembler.assembleDocument(CommonUtilities.getTestDataPath(srcDocument), | |
CommonUtilities.getTestOutPath(docReport), new DataSourceInfo(new DataStorage(), null)); | |
} catch (Exception exp) { | |
System.out.println("Exception: " + exp.getMessage()); | |
} |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.