ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Reader_Excel2003XML Class Reference
+ Inheritance diagram for PHPExcel_Reader_Excel2003XML:
+ Collaboration diagram for PHPExcel_Reader_Excel2003XML:

Public Member Functions

 getReadDataOnly ()
 Read data only?
 setReadDataOnly ($pValue=false)
 Set read data only.
 getLoadSheetsOnly ()
 Get which sheets to load.
 setLoadSheetsOnly ($value=null)
 Set which sheets to load.
 setLoadAllSheets ()
 Set all sheets to load.
 getReadFilter ()
 Read filter.
 setReadFilter (PHPExcel_Reader_IReadFilter $pValue)
 Set read filter.
 __construct ()
 Create a new PHPExcel_Reader_Excel2003XML.
 canRead ($pFilename)
 Can the current PHPExcel_Reader_IReader read the file?
 listWorksheetNames ($pFilename)
 Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object.
 load ($pFilename)
 Loads PHPExcel from file.
 loadIntoExisting ($pFilename, PHPExcel $objPHPExcel)
 Loads PHPExcel from file into PHPExcel instance.

Private Member Functions

 _parseRichText ($is= '')

Static Private Member Functions

static identifyFixedStyleValue ($styleList, &$styleAttributeValue)
static _pixel2WidthUnits ($pxs)
 pixel units to excel width units(units of 1/256th of a character width)
static _widthUnits2Pixel ($widthUnits)
 excel width units(units of 1/256th of a character width) to pixel units
static _hex2str ($hex)

Private Attributes

 $_readDataOnly = false
 $_loadSheetsOnly = null
 $_styles = array()
 $_readFilter = null

Detailed Description

Definition at line 45 of file Excel2003XML.php.

Constructor & Destructor Documentation

PHPExcel_Reader_Excel2003XML::__construct ( )

Create a new PHPExcel_Reader_Excel2003XML.

Definition at line 153 of file Excel2003XML.php.

{
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
}

Member Function Documentation

static PHPExcel_Reader_Excel2003XML::_hex2str (   $hex)
staticprivate

Definition at line 284 of file Excel2003XML.php.

{
return chr(hexdec($hex[1]));
}
PHPExcel_Reader_Excel2003XML::_parseRichText (   $is = '')
private

Definition at line 779 of file Excel2003XML.php.

Referenced by loadIntoExisting().

{
$value = new PHPExcel_RichText();
$value->createText($is);
return $value;
}

+ Here is the caller graph for this function:

static PHPExcel_Reader_Excel2003XML::_pixel2WidthUnits (   $pxs)
staticprivate

pixel units to excel width units(units of 1/256th of a character width)

Parameters
pxs
Returns

Definition at line 263 of file Excel2003XML.php.

{
$UNIT_OFFSET_MAP = array(0, 36, 73, 109, 146, 182, 219);
$widthUnits = 256 * ($pxs / 7);
$widthUnits += $UNIT_OFFSET_MAP[($pxs % 7)];
return $widthUnits;
}
static PHPExcel_Reader_Excel2003XML::_widthUnits2Pixel (   $widthUnits)
staticprivate

excel width units(units of 1/256th of a character width) to pixel units

Parameters
widthUnits
Returns

Definition at line 276 of file Excel2003XML.php.

{
$pixels = ($widthUnits / 256) * 7;
$offsetWidthUnits = $widthUnits % 256;
$pixels += round($offsetWidthUnits / (256 / 7));
return $pixels;
}
PHPExcel_Reader_Excel2003XML::canRead (   $pFilename)

Can the current PHPExcel_Reader_IReader read the file?

Parameters
string$pFileName
Returns
boolean

Implements PHPExcel_Reader_IReader.

Definition at line 163 of file Excel2003XML.php.

References $data, and $valid.

{
// Office xmlns:o="urn:schemas-microsoft-com:office:office"
// Excel xmlns:x="urn:schemas-microsoft-com:office:excel"
// XML Spreadsheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
// Spreadsheet component xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"
// XML schema xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
// XML data type xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
// MS-persist recordset xmlns:rs="urn:schemas-microsoft-com:rowset"
// Rowset xmlns:z="#RowsetSchema"
//
$signature = array(
'<?xml version="1.0"',
'<?mso-application progid="Excel.Sheet"?>'
);
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
// Read sample data (first 2 KB will do)
$fh = fopen($pFilename, 'r');
$data = fread($fh, 2048);
fclose($fh);
$valid = true;
foreach($signature as $match) {
// every part of the signature must be present
if (strpos($data, $match) === false) {
$valid = false;
break;
}
}
return $valid;
}
PHPExcel_Reader_Excel2003XML::getLoadSheetsOnly ( )

Get which sheets to load.

Returns
mixed

Definition at line 101 of file Excel2003XML.php.

References $_loadSheetsOnly.

PHPExcel_Reader_Excel2003XML::getReadDataOnly ( )

Read data only?

Returns
boolean

Definition at line 81 of file Excel2003XML.php.

References $_readDataOnly.

{
}
PHPExcel_Reader_Excel2003XML::getReadFilter ( )

Read filter.

Returns
PHPExcel_Reader_IReadFilter

Definition at line 135 of file Excel2003XML.php.

References $_readFilter.

Referenced by loadIntoExisting().

{
}

+ Here is the caller graph for this function:

static PHPExcel_Reader_Excel2003XML::identifyFixedStyleValue (   $styleList,
$styleAttributeValue 
)
staticprivate

Definition at line 247 of file Excel2003XML.php.

{
$styleAttributeValue = strtolower($styleAttributeValue);
foreach($styleList as $style) {
if ($styleAttributeValue == strtolower($style)) {
$styleAttributeValue = $style;
return true;
}
}
return false;
}
PHPExcel_Reader_Excel2003XML::listWorksheetNames (   $pFilename)

Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object.

Parameters
string$pFilename
Exceptions
Exception

Definition at line 209 of file Excel2003XML.php.

{
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
$worksheetNames = array();
$xml = simplexml_load_file($pFilename);
$namespaces = $xml->getNamespaces(true);
$xml_ss = $xml->children($namespaces['ss']);
foreach($xml_ss->Worksheet as $worksheet) {
$worksheet_ss = $worksheet->attributes($namespaces['ss']);
$worksheetNames[] = $worksheet_ss['Name'];
}
return $worksheetNames;
}
PHPExcel_Reader_Excel2003XML::load (   $pFilename)

Loads PHPExcel from file.

Parameters
string$pFilename
Returns
PHPExcel
Exceptions
Exception

Implements PHPExcel_Reader_IReader.

Definition at line 238 of file Excel2003XML.php.

References loadIntoExisting().

{
// Create new PHPExcel
$objPHPExcel = new PHPExcel();
// Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel);
}

+ Here is the call graph for this function:

PHPExcel_Reader_Excel2003XML::loadIntoExisting (   $pFilename,
PHPExcel  $objPHPExcel 
)

Loads PHPExcel from file into PHPExcel instance.

Parameters
string$pFilename
PHPExcel$objPHPExcel
Returns
PHPExcel
Exceptions
Exception

Definition at line 296 of file Excel2003XML.php.

References $type, _parseRichText(), PHPExcel_Style_Border\BORDER_MEDIUM, PHPExcel_Cell\columnIndexFromString(), PHPExcel\createSheet(), PHPExcel\getActiveSheet(), PHPExcel\getProperties(), getReadFilter(), PHPExcel_Style_Alignment\HORIZONTAL_CENTER, PHPExcel_Style_Alignment\HORIZONTAL_CENTER_CONTINUOUS, PHPExcel_Style_Alignment\HORIZONTAL_GENERAL, PHPExcel_Style_Alignment\HORIZONTAL_JUSTIFY, PHPExcel_Style_Alignment\HORIZONTAL_LEFT, PHPExcel_Style_Alignment\HORIZONTAL_RIGHT, PHPExcel_Shared_Date\PHPToExcel(), PHPExcel_DocumentProperties\PROPERTY_TYPE_BOOLEAN, PHPExcel_DocumentProperties\PROPERTY_TYPE_DATE, PHPExcel_DocumentProperties\PROPERTY_TYPE_FLOAT, PHPExcel_DocumentProperties\PROPERTY_TYPE_INTEGER, PHPExcel_DocumentProperties\PROPERTY_TYPE_STRING, PHPExcel_DocumentProperties\PROPERTY_TYPE_UNKNOWN, PHPExcel\setActiveSheetIndex(), PHPExcel_Cell\stringFromColumnIndex(), PHPExcel_Cell_DataType\TYPE_BOOL, PHPExcel_Cell_DataType\TYPE_ERROR, PHPExcel_Cell_DataType\TYPE_FORMULA, PHPExcel_Cell_DataType\TYPE_NULL, PHPExcel_Cell_DataType\TYPE_NUMERIC, PHPExcel_Cell_DataType\TYPE_STRING, PHPExcel_Style_Font\UNDERLINE_DOUBLE, PHPExcel_Style_Font\UNDERLINE_DOUBLEACCOUNTING, PHPExcel_Style_Font\UNDERLINE_NONE, PHPExcel_Style_Font\UNDERLINE_SINGLE, PHPExcel_Style_Font\UNDERLINE_SINGLEACCOUNTING, PHPExcel_Style_Alignment\VERTICAL_BOTTOM, PHPExcel_Style_Alignment\VERTICAL_CENTER, PHPExcel_Style_Alignment\VERTICAL_JUSTIFY, and PHPExcel_Style_Alignment\VERTICAL_TOP.

Referenced by load().

{
$fromFormats = array('\-', '\ ');
$toFormats = array('-', ' ');
$underlineStyles = array (
);
$verticalAlignmentStyles = array (
);
$horizontalAlignmentStyles = array (
);
$timezoneObj = new DateTimeZone('Europe/London');
$GMT = new DateTimeZone('UTC');
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
$xml = simplexml_load_file($pFilename);
$namespaces = $xml->getNamespaces(true);
$docProps = $objPHPExcel->getProperties();
if (isset($xml->DocumentProperties[0])) {
foreach($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
switch ($propertyName) {
case 'Title' :
$docProps->setTitle($propertyValue);
break;
case 'Subject' :
$docProps->setSubject($propertyValue);
break;
case 'Author' :
$docProps->setCreator($propertyValue);
break;
case 'Created' :
$creationDate = strtotime($propertyValue);
$docProps->setCreated($creationDate);
break;
case 'LastAuthor' :
$docProps->setLastModifiedBy($propertyValue);
break;
case 'LastSaved' :
$lastSaveDate = strtotime($propertyValue);
$docProps->setModified($lastSaveDate);
break;
case 'Company' :
$docProps->setCompany($propertyValue);
break;
case 'Category' :
$docProps->setCategory($propertyValue);
break;
case 'Manager' :
$docProps->setManager($propertyValue);
break;
case 'Keywords' :
$docProps->setKeywords($propertyValue);
break;
case 'Description' :
$docProps->setDescription($propertyValue);
break;
}
}
}
if (isset($xml->CustomDocumentProperties)) {
foreach($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) {
$propertyAttributes = $propertyValue->attributes($namespaces['dt']);
$propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/','PHPExcel_Reader_Excel2003XML::_hex2str',$propertyName);
switch((string) $propertyAttributes) {
case 'string' :
$propertyValue = trim($propertyValue);
break;
case 'boolean' :
$propertyValue = (bool) $propertyValue;
break;
case 'integer' :
$propertyValue = intval($propertyValue);
break;
case 'float' :
$propertyValue = floatval($propertyValue);
break;
case 'dateTime.tz' :
$propertyValue = strtotime(trim($propertyValue));
break;
}
$docProps->setCustomProperty($propertyName,$propertyValue,$propertyType);
}
}
foreach($xml->Styles[0] as $style) {
$style_ss = $style->attributes($namespaces['ss']);
$styleID = (string) $style_ss['ID'];
// echo 'Style ID = '.$styleID.'<br />';
if ($styleID == 'Default') {
$this->_styles['Default'] = array();
} else {
$this->_styles[$styleID] = $this->_styles['Default'];
}
foreach ($style as $styleType => $styleData) {
$styleAttributes = $styleData->attributes($namespaces['ss']);
// echo $styleType.'<br />';
switch ($styleType) {
case 'Alignment' :
foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
$styleAttributeValue = (string) $styleAttributeValue;
switch ($styleAttributeKey) {
case 'Vertical' :
if (self::identifyFixedStyleValue($verticalAlignmentStyles,$styleAttributeValue)) {
$this->_styles[$styleID]['alignment']['vertical'] = $styleAttributeValue;
}
break;
case 'Horizontal' :
if (self::identifyFixedStyleValue($horizontalAlignmentStyles,$styleAttributeValue)) {
$this->_styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue;
}
break;
case 'WrapText' :
$this->_styles[$styleID]['alignment']['wrap'] = true;
break;
}
}
break;
case 'Borders' :
foreach($styleData->Border as $borderStyle) {
$borderAttributes = $borderStyle->attributes($namespaces['ss']);
$thisBorder = array();
foreach($borderAttributes as $borderStyleKey => $borderStyleValue) {
// echo $borderStyleKey.' = '.$borderStyleValue.'<br />';
switch ($borderStyleKey) {
case 'LineStyle' :
$thisBorder['style'] = PHPExcel_Style_Border::BORDER_MEDIUM;
// $thisBorder['style'] = $borderStyleValue;
break;
case 'Weight' :
// $thisBorder['style'] = $borderStyleValue;
break;
case 'Position' :
$borderPosition = strtolower($borderStyleValue);
break;
case 'Color' :
$borderColour = substr($borderStyleValue,1);
$thisBorder['color']['rgb'] = $borderColour;
break;
}
}
if (count($thisBorder) > 0) {
if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) {
$this->_styles[$styleID]['borders'][$borderPosition] = $thisBorder;
}
}
}
break;
case 'Font' :
foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
$styleAttributeValue = (string) $styleAttributeValue;
switch ($styleAttributeKey) {
case 'FontName' :
$this->_styles[$styleID]['font']['name'] = $styleAttributeValue;
break;
case 'Size' :
$this->_styles[$styleID]['font']['size'] = $styleAttributeValue;
break;
case 'Color' :
$this->_styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue,1);
break;
case 'Bold' :
$this->_styles[$styleID]['font']['bold'] = true;
break;
case 'Italic' :
$this->_styles[$styleID]['font']['italic'] = true;
break;
case 'Underline' :
if (self::identifyFixedStyleValue($underlineStyles,$styleAttributeValue)) {
$this->_styles[$styleID]['font']['underline'] = $styleAttributeValue;
}
break;
}
}
break;
case 'Interior' :
foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
switch ($styleAttributeKey) {
case 'Color' :
$this->_styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue,1);
break;
}
}
break;
case 'NumberFormat' :
foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
$styleAttributeValue = str_replace($fromFormats,$toFormats,$styleAttributeValue);
switch ($styleAttributeValue) {
case 'Short Date' :
$styleAttributeValue = 'dd/mm/yyyy';
break;
}
if ($styleAttributeValue > '') {
$this->_styles[$styleID]['numberformat']['code'] = $styleAttributeValue;
}
}
break;
case 'Protection' :
foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
}
break;
}
}
// print_r($this->_styles[$styleID]);
// echo '<hr />';
}
// echo '<hr />';
$worksheetID = 0;
$xml_ss = $xml->children($namespaces['ss']);
foreach($xml_ss->Worksheet as $worksheet) {
$worksheet_ss = $worksheet->attributes($namespaces['ss']);
if ((isset($this->_loadSheetsOnly)) && (isset($worksheet_ss['Name'])) &&
(!in_array($worksheet_ss['Name'], $this->_loadSheetsOnly))) {
continue;
}
// echo '<h3>Worksheet: ',$worksheet_ss['Name'],'<h3>';
//
// Create new Worksheet
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID);
if (isset($worksheet_ss['Name'])) {
$worksheetName = (string) $worksheet_ss['Name'];
$objPHPExcel->getActiveSheet()->setTitle($worksheetName);
}
$columnID = 'A';
if (isset($worksheet->Table->Column)) {
foreach($worksheet->Table->Column as $columnData) {
$columnData_ss = $columnData->attributes($namespaces['ss']);
if (isset($columnData_ss['Index'])) {
$columnID = PHPExcel_Cell::stringFromColumnIndex($columnData_ss['Index']-1);
}
if (isset($columnData_ss['Width'])) {
$columnWidth = $columnData_ss['Width'];
// echo '<b>Setting column width for '.$columnID.' to '.$columnWidth.'</b><br />';
$objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4);
}
++$columnID;
}
}
$rowID = 1;
if (isset($worksheet->Table->Row)) {
foreach($worksheet->Table->Row as $rowData) {
$rowHasData = false;
$row_ss = $rowData->attributes($namespaces['ss']);
if (isset($row_ss['Index'])) {
$rowID = (integer) $row_ss['Index'];
}
// echo '<b>Row '.$rowID.'</b><br />';
$columnID = 'A';
foreach($rowData->Cell as $cell) {
$cell_ss = $cell->attributes($namespaces['ss']);
if (isset($cell_ss['Index'])) {
$columnID = PHPExcel_Cell::stringFromColumnIndex($cell_ss['Index']-1);
}
$cellRange = $columnID.$rowID;
if (!is_null($this->getReadFilter())) {
if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) {
continue;
}
}
if ((isset($cell_ss['MergeAcross'])) || (isset($cell_ss['MergeDown']))) {
$columnTo = $columnID;
if (isset($cell_ss['MergeAcross'])) {
$columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1);
}
$rowTo = $rowID;
if (isset($cell_ss['MergeDown'])) {
$rowTo = $rowTo + $cell_ss['MergeDown'];
}
$cellRange .= ':'.$columnTo.$rowTo;
$objPHPExcel->getActiveSheet()->mergeCells($cellRange);
}
$cellIsSet = $hasCalculatedValue = false;
$cellDataFormula = '';
if (isset($cell_ss['Formula'])) {
$cellDataFormula = $cell_ss['Formula'];
// added this as a check for array formulas
if (isset($cell_ss['ArrayRange'])) {
$cellDataCSEFormula = $cell_ss['ArrayRange'];
// echo "found an array formula at ".$columnID.$rowID."<br />";
}
$hasCalculatedValue = true;
}
if (isset($cell->Data)) {
$cellValue = $cellData = $cell->Data;
$cellData_ss = $cellData->attributes($namespaces['ss']);
if (isset($cellData_ss['Type'])) {
$cellDataType = $cellData_ss['Type'];
switch ($cellDataType) {
/*
const TYPE_STRING = 's';
const TYPE_FORMULA = 'f';
const TYPE_NUMERIC = 'n';
const TYPE_BOOL = 'b';
const TYPE_NULL = 's';
const TYPE_INLINE = 'inlineStr';
const TYPE_ERROR = 'e';
*/
case 'String' :
break;
case 'Number' :
$cellValue = (float) $cellValue;
if (floor($cellValue) == $cellValue) {
$cellValue = (integer) $cellValue;
}
break;
case 'Boolean' :
$cellValue = ($cellValue != 0);
break;
case 'DateTime' :
$cellValue = PHPExcel_Shared_Date::PHPToExcel(strtotime($cellValue));
break;
case 'Error' :
break;
}
}
if ($hasCalculatedValue) {
// echo 'FORMULA<br />';
$columnNumber = PHPExcel_Cell::columnIndexFromString($columnID);
if (substr($cellDataFormula,0,3) == 'of:') {
$cellDataFormula = substr($cellDataFormula,3);
// echo 'Before: ',$cellDataFormula,'<br />';
$temp = explode('"',$cellDataFormula);
$key = false;
foreach($temp as &$value) {
// Only replace in alternate array entries (i.e. non-quoted blocks)
if ($key = !$key) {
$value = str_replace(array('[.','.',']'),'',$value);
}
}
} else {
// Convert R1C1 style references to A1 style references (but only when not quoted)
// echo 'Before: ',$cellDataFormula,'<br />';
$temp = explode('"',$cellDataFormula);
$key = false;
foreach($temp as &$value) {
// Only replace in alternate array entries (i.e. non-quoted blocks)
if ($key = !$key) {
preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/',$value, $cellReferences,PREG_SET_ORDER+PREG_OFFSET_CAPTURE);
// Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way
// through the formula from left to right. Reversing means that we work right to left.through
// the formula
$cellReferences = array_reverse($cellReferences);
// Loop through each R1C1 style reference in turn, converting it to its A1 style equivalent,
// then modify the formula to use that new reference
foreach($cellReferences as $cellReference) {
$rowReference = $cellReference[2][0];
// Empty R reference is the current row
if ($rowReference == '') $rowReference = $rowID;
// Bracketed R references are relative to the current row
if ($rowReference{0} == '[') $rowReference = $rowID + trim($rowReference,'[]');
$columnReference = $cellReference[4][0];
// Empty C reference is the current column
if ($columnReference == '') $columnReference = $columnNumber;
// Bracketed C references are relative to the current column
if ($columnReference{0} == '[') $columnReference = $columnNumber + trim($columnReference,'[]');
$A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference;
$value = substr_replace($value,$A1CellReference,$cellReference[0][1],strlen($cellReference[0][0]));
}
}
}
}
unset($value);
// Then rebuild the formula string
$cellDataFormula = implode('"',$temp);
// echo 'After: ',$cellDataFormula,'<br />';
}
// echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'<br />';
//
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue),$type);
if ($hasCalculatedValue) {
// echo 'Formula result is '.$cellValue.'<br />';
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue);
}
$cellIsSet = $rowHasData = true;
}
if (isset($cell->Comment)) {
// echo '<b>comment found</b><br />';
$commentAttributes = $cell->Comment->attributes($namespaces['ss']);
$author = 'unknown';
if (isset($commentAttributes->Author)) {
$author = (string)$commentAttributes->Author;
// echo 'Author: ',$author,'<br />';
}
$node = $cell->Comment->Data->asXML();
// $annotation = str_replace('html:','',substr($node,49,-10));
// echo $annotation,'<br />';
$annotation = strip_tags($node);
// echo 'Annotation: ',$annotation,'<br />';
$objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID )
->setAuthor( $author )
->setText($this->_parseRichText($annotation) );
}
if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
$style = (string) $cell_ss['StyleID'];
// echo 'Cell style for '.$columnID.$rowID.' is '.$style.'<br />';
if ((isset($this->_styles[$style])) && (count($this->_styles[$style]) > 0)) {
// echo 'Cell '.$columnID.$rowID.'<br />';
// print_r($this->_styles[$style]);
// echo '<br />';
if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) {
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(NULL);
}
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->_styles[$style]);
}
}
++$columnID;
}
if ($rowHasData) {
if (isset($row_ss['StyleID'])) {
$rowStyle = $row_ss['StyleID'];
}
if (isset($row_ss['Height'])) {
$rowHeight = $row_ss['Height'];
// echo '<b>Setting row height to '.$rowHeight.'</b><br />';
$objPHPExcel->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight);
}
}
++$rowID;
}
}
++$worksheetID;
}
// Return
return $objPHPExcel;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Reader_Excel2003XML::setLoadAllSheets ( )

Set all sheets to load.

Returns
PHPExcel_Reader_Excel2003XML

Definition at line 124 of file Excel2003XML.php.

{
$this->_loadSheetsOnly = null;
return $this;
}
PHPExcel_Reader_Excel2003XML::setLoadSheetsOnly (   $value = null)

Set which sheets to load.

Parameters
mixed$value
Returns
PHPExcel_Reader_Excel2003XML

Definition at line 112 of file Excel2003XML.php.

{
$this->_loadSheetsOnly = is_array($value) ?
$value : array($value);
return $this;
}
PHPExcel_Reader_Excel2003XML::setReadDataOnly (   $pValue = false)

Set read data only.

Parameters
boolean$pValue
Returns
PHPExcel_Reader_Excel2003XML

Definition at line 91 of file Excel2003XML.php.

{
$this->_readDataOnly = $pValue;
return $this;
}
PHPExcel_Reader_Excel2003XML::setReadFilter ( PHPExcel_Reader_IReadFilter  $pValue)

Set read filter.

Parameters
PHPExcel_Reader_IReadFilter$pValue
Returns
PHPExcel_Reader_Excel2003XML

Definition at line 145 of file Excel2003XML.php.

{
$this->_readFilter = $pValue;
return $this;
}

Field Documentation

PHPExcel_Reader_Excel2003XML::$_loadSheetsOnly = null
private

Definition at line 59 of file Excel2003XML.php.

Referenced by getLoadSheetsOnly().

PHPExcel_Reader_Excel2003XML::$_readDataOnly = false
private

Definition at line 52 of file Excel2003XML.php.

Referenced by getReadDataOnly().

PHPExcel_Reader_Excel2003XML::$_readFilter = null
private

Definition at line 73 of file Excel2003XML.php.

Referenced by getReadFilter().

PHPExcel_Reader_Excel2003XML::$_styles = array()
private

Definition at line 66 of file Excel2003XML.php.


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