300 $this->_paperSize = $pValue;
320 $this->_orientation = $pValue;
344 public function setScale($pValue = 100, $pUpdate =
true) {
347 if (($pValue >= 0) || is_null($pValue)) {
348 $this->_scale = $pValue;
350 $this->_fitToPage =
false;
353 throw new Exception(
"Scale must not be negative");
374 $this->_fitToPage = $pValue;
395 $this->_fitToHeight = $pValue;
397 $this->_fitToPage =
true;
419 $this->_fitToWidth = $pValue;
421 $this->_fitToPage =
true;
432 if (is_array($this->_columnsToRepeatAtLeft)) {
433 if ($this->_columnsToRepeatAtLeft[0] !=
'' && $this->_columnsToRepeatAtLeft[1] !=
'') {
457 if (is_array($pValue)) {
458 $this->_columnsToRepeatAtLeft = $pValue;
471 $this->_columnsToRepeatAtLeft = array($pStart, $pEnd);
481 if (is_array($this->_rowsToRepeatAtTop)) {
482 if ($this->_rowsToRepeatAtTop[0] != 0 && $this->_rowsToRepeatAtTop[1] != 0) {
506 if (is_array($pValue)) {
507 $this->_rowsToRepeatAtTop = $pValue;
520 $this->_rowsToRepeatAtTop = array($pStart, $pEnd);
540 $this->_horizontalCentered = $value;
560 $this->_verticalCentered = $value;
578 $printAreas = explode(
',',$this->_printArea);
579 if (isset($printAreas[$index-1])) {
580 return $printAreas[$index-1];
582 throw new Exception(
"Requested Print Area does not exist");
596 return !is_null($this->_printArea);
598 $printAreas = explode(
',',$this->_printArea);
599 return isset($printAreas[$index-1]);
613 $this->_printArea = NULL;
615 $printAreas = explode(
',',$this->_printArea);
616 if (isset($printAreas[$index-1])) {
617 unset($printAreas[$index-1]);
618 $this->_printArea = implode(
',',$printAreas);
645 public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) {
646 if (strpos($value,
'!') !==
false) {
647 throw new Exception(
'Cell coordinate must not specify a worksheet.');
648 } elseif (strpos($value,
':') ===
false) {
649 throw new Exception(
'Cell coordinate must be a range of cells.');
650 } elseif (strpos($value,
'$') !==
false) {
651 throw new Exception(
'Cell coordinate must not be absolute.');
653 $value = strtoupper($value);
655 if ($method == self::SETPRINTRANGE_OVERWRITE) {
657 $this->_printArea = $value;
659 $printAreas = explode(
',',$this->_printArea);
661 $index = count($printAreas) - abs($index) + 1;
663 if (($index <= 0) || ($index > count($printAreas))) {
664 throw new Exception(
'Invalid index for setting print range.');
666 $printAreas[$index-1] = $value;
667 $this->_printArea = implode(
',',$printAreas);
669 } elseif($method == self::SETPRINTRANGE_INSERT) {
671 $this->_printArea .= ($this->_printArea ==
'') ? $value :
','.$value;
673 $printAreas = explode(
',',$this->_printArea);
675 $index = abs($index) - 1;
677 if ($index > count($printAreas)) {
678 throw new Exception(
'Invalid index for setting print range.');
680 $printAreas = array_merge(array_slice($printAreas,0,$index),array($value),array_slice($printAreas,$index));
681 $this->_printArea = implode(
',',$printAreas);
684 throw new Exception(
'Invalid method for setting print range.');
704 return $this->
setPrintArea($value, $index, self::SETPRINTRANGE_INSERT);
772 $this->_firstPageNumber = $value;
789 $vars = get_object_vars($this);
790 foreach ($vars as $key => $value) {
791 if (is_object($value)) {
792 $this->$key = clone $value;
794 $this->$key = $value;