workbook.getSettings().setRecalculateBeforeSave(true) is not effective when workbook is saved as PDF.
I need to add an explicit workbook.calculateFormula() before saving.
Hi,
Thanks for your query.
Well, I think you may try to use PdfSaveOptions.setCalculateFormula() method, it will suit your needs:
e.g
Sample code:
…
PdfSaveOptions pdfOptions = new PdfSaveOptions(SaveFormat.PDF);
// Calculate formulas before saving to PDF.
pdfOptions.setCalculateFormula(true);
workbook.save(outputPdfFile, pdfOptions);
Hope, this helps a bit.
Thank you.
Both solutions work but it does not prevent ‘setRecalculateBeforeSave’ from not workink as attended.
Hi,
Thank you.