ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Writer_Excel5 Class Reference
+ Inheritance diagram for PHPExcel_Writer_Excel5:
+ Collaboration diagram for PHPExcel_Writer_Excel5:

Public Member Functions

 __construct (PHPExcel $phpExcel)
 Create a new PHPExcel_Writer_Excel5.
 save ($pFilename=null)
 Save PHPExcel to file.
 getTempDir ()
 Get temporary storage directory.
 setTempDir ($pValue= '')
 Set temporary storage directory.

Private Attributes

 $_phpExcel
 $_BIFF_version
 $_tempDir = ''
 $_str_total
 $_str_unique
 $_str_table
 $_parser

Detailed Description

Definition at line 66 of file Excel5.php.

Constructor & Destructor Documentation

PHPExcel_Writer_Excel5::__construct ( PHPExcel  $phpExcel)

Create a new PHPExcel_Writer_Excel5.

Parameters
PHPExcel$phpExcelPHPExcel object

Definition at line 123 of file Excel5.php.

{
$this->_phpExcel = $phpExcel;
$this->_BIFF_version = 0x0600;
$this->_tempDir = '';
$this->_str_total = 0;
$this->_str_unique = 0;
$this->_str_table = array();
$this->_parser = new PHPExcel_Writer_Excel5_Parser($this->_BIFF_version);
}

Member Function Documentation

PHPExcel_Writer_Excel5::getTempDir ( )

Get temporary storage directory.

Returns
string

Definition at line 231 of file Excel5.php.

References $_tempDir.

{
}
PHPExcel_Writer_Excel5::save (   $pFilename = null)

Save PHPExcel to file.

Parameters
string$pFileName
Exceptions
Exception

Implements PHPExcel_Writer_IWriter.

Definition at line 141 of file Excel5.php.

References $res, PHPExcel_Shared_OLE\Asc2Ucs(), PHPExcel_Calculation_Functions\getReturnDateType(), PHPExcel_Calculation_Functions\RETURNDATE_EXCEL, and PHPExcel_Calculation_Functions\setReturnDateType().

{
// check mbstring.func_overload
if (ini_get('mbstring.func_overload') != 0) {
throw new Exception('Multibyte string function overloading in PHP must be disabled.');
}
// garbage collect
$this->_phpExcel->garbageCollect();
// Initialise workbook writer
$this->_writerWorkbook = new PHPExcel_Writer_Excel5_Workbook($this->_phpExcel, $this->_BIFF_version,
$this->_str_total, $this->_str_unique, $this->_str_table, $this->_parser, $this->_tempDir);
// Initialise worksheet writers
$countSheets = count($this->_phpExcel->getAllSheets());
for ($i = 0; $i < $countSheets; ++$i) {
$phpSheet = $this->_phpExcel->getSheet($i);
$writerWorksheet = new PHPExcel_Writer_Excel5_Worksheet($this->_BIFF_version,
$this->_str_total, $this->_str_unique,
$this->_str_table,
$this->_parser, $this->_tempDir,
$phpSheet);
$this->_writerWorksheets[$i] = $writerWorksheet;
}
// add 15 identical cell style Xfs
// for now, we use the first cellXf instead of cellStyleXf
$cellXfCollection = $this->_phpExcel->getCellXfCollection();
for ($i = 0; $i < 15; ++$i) {
$this->_writerWorkbook->addXfWriter($cellXfCollection[0], true);
}
// add all the cell Xfs
foreach ($this->_phpExcel->getCellXfCollection() as $style) {
$this->_writerWorkbook->addXfWriter($style, false);
}
// initialize OLE file
$workbookStreamName = ($this->_BIFF_version == 0x0600) ? 'Workbook' : 'Book';
if ($this->_tempDir != '') {
$OLE->setTempDir($this->_tempDir);
}
$res = $OLE->init();
// Write the worksheet streams before the global workbook stream,
// because the byte sizes of these are needed in the global workbook stream
$worksheetSizes = array();
for ($i = 0; $i < $countSheets; ++$i) {
$this->_writerWorksheets[$i]->close();
$worksheetSizes[] = $this->_writerWorksheets[$i]->_datasize;
}
// add binary data for global workbook stream
$OLE->append( $this->_writerWorkbook->writeWorkbook($worksheetSizes) );
// add binary data for sheet streams
for ($i = 0; $i < $countSheets; ++$i) {
while ( ($tmp = $this->_writerWorksheets[$i]->getData()) !== false ) {
$OLE->append($tmp);
}
}
$root = new PHPExcel_Shared_OLE_PPS_Root(time(), time(), array($OLE));
if ($this->_tempDir != '') {
$root->setTempDir($this->_tempDir);
}
// save the OLE file
$res = $root->save($pFilename);
// clean up
foreach ($this->_writerWorksheets as $sheet) {
$sheet->cleanup();
}
}

+ Here is the call graph for this function:

PHPExcel_Writer_Excel5::setTempDir (   $pValue = '')

Set temporary storage directory.

Parameters
string$pValueTemporary storage directory
Exceptions
ExceptionException when directory does not exist
Returns
PHPExcel_Writer_Excel5

Definition at line 242 of file Excel5.php.

{
if (is_dir($pValue)) {
$this->_tempDir = $pValue;
} else {
throw new Exception("Directory does not exist: $pValue");
}
return $this;
}

Field Documentation

PHPExcel_Writer_Excel5::$_BIFF_version
private

Definition at line 80 of file Excel5.php.

PHPExcel_Writer_Excel5::$_parser
private

Definition at line 115 of file Excel5.php.

PHPExcel_Writer_Excel5::$_phpExcel
private

Definition at line 73 of file Excel5.php.

PHPExcel_Writer_Excel5::$_str_table
private

Definition at line 108 of file Excel5.php.

PHPExcel_Writer_Excel5::$_str_total
private

Definition at line 94 of file Excel5.php.

PHPExcel_Writer_Excel5::$_str_unique
private

Definition at line 101 of file Excel5.php.

PHPExcel_Writer_Excel5::$_tempDir = ''
private

Definition at line 87 of file Excel5.php.

Referenced by getTempDir().


The documentation for this class was generated from the following file: