4
* PHPExcel_Writer_Abstract
6
* Copyright (c) 2006 - 2015 PHPExcel
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
* @package PHPExcel_Writer
24
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
25
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
26
* @version ##VERSION##, ##DATE##
28
abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
31
* Write charts that are defined in the workbook?
32
* Identifies whether the Writer should write definitions for any charts that exist in the PHPExcel object;
36
protected $includeCharts = false;
39
* Pre-calculate formulas
40
* Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are
41
* immediately available to MS Excel or other office spreadsheet viewer when opening the file
45
protected $preCalculateFormulas = true;
48
* Use disk caching where possible?
52
protected $_useDiskCaching = false;
55
* Disk caching directory
59
protected $_diskCachingDirectory = './';
62
* Write charts in workbook?
63
* If this is true, then the Writer will write definitions for any charts that exist in the PHPExcel object.
64
* If false (the default) it will ignore any charts defined in the PHPExcel object.
68
public function getIncludeCharts()
70
return $this->includeCharts;
74
* Set write charts in workbook
75
* Set to true, to advise the Writer to include any charts that exist in the PHPExcel object.
76
* Set to false (the default) to ignore charts.
78
* @param boolean $pValue
79
* @return PHPExcel_Writer_IWriter
81
public function setIncludeCharts($pValue = false)
83
$this->includeCharts = (boolean) $pValue;
88
* Get Pre-Calculate Formulas flag
89
* If this is true (the default), then the writer will recalculate all formulae in a workbook when saving,
90
* so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet
91
* viewer when opening the file
92
* If false, then formulae are not calculated on save. This is faster for saving in PHPExcel, but slower
93
* when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself
97
public function getPreCalculateFormulas()
99
return $this->preCalculateFormulas;
103
* Set Pre-Calculate Formulas
104
* Set to true (the default) to advise the Writer to calculate all formulae on save
105
* Set to false to prevent precalculation of formulae on save.
107
* @param boolean $pValue Pre-Calculate Formulas?
108
* @return PHPExcel_Writer_IWriter
110
public function setPreCalculateFormulas($pValue = true)
112
$this->preCalculateFormulas = (boolean) $pValue;
117
* Get use disk caching where possible?
121
public function getUseDiskCaching()
123
return $this->_useDiskCaching;
127
* Set use disk caching where possible?
129
* @param boolean $pValue
130
* @param string $pDirectory Disk caching directory
131
* @throws PHPExcel_Writer_Exception when directory does not exist
132
* @return PHPExcel_Writer_Excel2007
134
public function setUseDiskCaching($pValue = false, $pDirectory = null)
136
$this->_useDiskCaching = $pValue;
138
if ($pDirectory !== null) {
139
if (is_dir($pDirectory)) {
140
$this->_diskCachingDirectory = $pDirectory;
142
throw new PHPExcel_Writer_Exception("Directory does not exist: $pDirectory");
149
* Get disk caching directory
153
public function getDiskCachingDirectory()
155
return $this->_diskCachingDirectory;