16 $this->worksheet = $workSheet;
25 if ($this->worksheetXml === null) {
29 if (isset($this->worksheetXml->sheetPr)) {
30 $this->
tabColor($this->worksheetXml->sheetPr);
31 $this->
codeName($this->worksheetXml->sheetPr);
32 $this->
outlines($this->worksheetXml->sheetPr);
33 $this->
pageSetup($this->worksheetXml->sheetPr);
36 if (isset($this->worksheetXml->sheetFormatPr)) {
37 $this->
sheetFormat($this->worksheetXml->sheetFormatPr);
40 if (!
$readDataOnly && isset($this->worksheetXml->printOptions)) {
47 if (isset($sheetPr->tabColor, $sheetPr->tabColor[
'rgb'])) {
48 $this->worksheet->getTabColor()->setARGB((
string) $sheetPr->tabColor[
'rgb']);
54 if (isset($sheetPr[
'codeName'])) {
55 $this->worksheet->setCodeName((
string) $sheetPr[
'codeName'],
false);
61 if (isset($sheetPr->outlinePr)) {
63 isset($sheetPr->outlinePr[
'summaryRight']) &&
64 !self::boolean((
string) $sheetPr->outlinePr[
'summaryRight'])
66 $this->worksheet->setShowSummaryRight(
false);
68 $this->worksheet->setShowSummaryRight(
true);
72 isset($sheetPr->outlinePr[
'summaryBelow']) &&
73 !self::boolean((
string) $sheetPr->outlinePr[
'summaryBelow'])
75 $this->worksheet->setShowSummaryBelow(
false);
77 $this->worksheet->setShowSummaryBelow(
true);
84 if (isset($sheetPr->pageSetUpPr)) {
86 isset($sheetPr->pageSetUpPr[
'fitToPage']) &&
87 !self::boolean((
string) $sheetPr->pageSetUpPr[
'fitToPage'])
89 $this->worksheet->getPageSetup()->setFitToPage(
false);
91 $this->worksheet->getPageSetup()->setFitToPage(
true);
99 isset($sheetFormatPr[
'customHeight']) &&
100 self::boolean((
string) $sheetFormatPr[
'customHeight']) &&
101 isset($sheetFormatPr[
'defaultRowHeight'])
103 $this->worksheet->getDefaultRowDimension()
104 ->setRowHeight((
float) $sheetFormatPr[
'defaultRowHeight']);
107 if (isset($sheetFormatPr[
'defaultColWidth'])) {
108 $this->worksheet->getDefaultColumnDimension()
109 ->setWidth((
float) $sheetFormatPr[
'defaultColWidth']);
113 isset($sheetFormatPr[
'zeroHeight']) &&
114 ((
string) $sheetFormatPr[
'zeroHeight'] ===
'1')
116 $this->worksheet->getDefaultRowDimension()->setZeroHeight(
true);
122 if (self::boolean((
string) $printOptions[
'gridLinesSet'])) {
123 $this->worksheet->setShowGridlines(
true);
125 if (self::boolean((
string) $printOptions[
'gridLines'])) {
126 $this->worksheet->setPrintGridlines(
true);
128 if (self::boolean((
string) $printOptions[
'horizontalCentered'])) {
129 $this->worksheet->getPageSetup()->setHorizontalCentered(
true);
131 if (self::boolean((
string) $printOptions[
'verticalCentered'])) {
132 $this->worksheet->getPageSetup()->setVerticalCentered(
true);
printOptions(SimpleXMLElement $printOptions)
codeName(SimpleXMLElement $sheetPr)
__construct(Worksheet $workSheet, ?SimpleXMLElement $worksheetXml=null)
load($readDataOnly=false)
pageSetup(SimpleXMLElement $sheetPr)
tabColor(SimpleXMLElement $sheetPr)
sheetFormat(SimpleXMLElement $sheetFormatPr)
outlines(SimpleXMLElement $sheetPr)