You are here

private function PHPExcel_Writer_Excel2007_Workbook::_writeCalcPr in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Workbook.php \PHPExcel_Writer_Excel2007_Workbook::_writeCalcPr()

* Write calcPr * *

Parameters

PHPExcel_Shared_XMLWriter $objWriter XML Writer: * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing * @throws PHPExcel_Writer_Exception

1 call to PHPExcel_Writer_Excel2007_Workbook::_writeCalcPr()
PHPExcel_Writer_Excel2007_Workbook::writeWorkbook in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Workbook.php
* Write workbook to XML format * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Workbook.php, line 193

Class

PHPExcel_Writer_Excel2007_Workbook
PHPExcel_Writer_Excel2007_Workbook

Code

private function _writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = TRUE) {
  $objWriter
    ->startElement('calcPr');

  //	Set the calcid to a higher value than Excel itself will use, otherwise Excel will always recalc
  //  If MS Excel does do a recalc, then users opening a file in MS Excel will be prompted to save on exit
  //     because the file has changed
  $objWriter
    ->writeAttribute('calcId', '999999');
  $objWriter
    ->writeAttribute('calcMode', 'auto');

  //	fullCalcOnLoad isn't needed if we've recalculating for the save
  $objWriter
    ->writeAttribute('calcCompleted', $recalcRequired ? 1 : 0);
  $objWriter
    ->writeAttribute('fullCalcOnLoad', $recalcRequired ? 0 : 1);
  $objWriter
    ->endElement();
}