本文整理汇总了PHP中PHPExcel_Worksheet::isTabColorSet方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Worksheet::isTabColorSet方法的具体用法?PHP PHPExcel_Worksheet::isTabColorSet怎么用?PHP PHPExcel_Worksheet::isTabColorSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Worksheet
的用法示例。
在下文中一共展示了PHPExcel_Worksheet::isTabColorSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _writeSheetLayout
/**
* Write SHEETLAYOUT record
*/
private function _writeSheetLayout()
{
if (!$this->_phpSheet->isTabColorSet()) {
return;
}
$recordData = pack('vvVVVvv', 0x862, 0x0, 0x0, 0x0, 0x14, $this->_colors[$this->_phpSheet->getTabColor()->getRGB()], 0x0);
$length = strlen($recordData);
$record = 0x862;
// Record identifier
$header = pack('vv', $record, $length);
$this->_append($header . $recordData);
}
示例2: _writeSheetPr
/**
* Write SheetPr
*
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
* @param PHPExcel_Worksheet $pSheet Worksheet
* @throws PHPExcel_Writer_Exception
*/
private function _writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
{
// sheetPr
$objWriter->startElement('sheetPr');
//$objWriter->writeAttribute('codeName', $pSheet->getTitle());
if ($pSheet->getParent()->hasMacros()) {
//if the workbook have macros, we need to have codeName for the sheet
if ($pSheet->hasCodeName() == false) {
$pSheet->setCodeName($pSheet->getTitle());
}
$objWriter->writeAttribute('codeName', $pSheet->getCodeName());
}
$autoFilterRange = $pSheet->getAutoFilter()->getRange();
if (!empty($autoFilterRange)) {
$objWriter->writeAttribute('filterMode', 1);
$pSheet->getAutoFilter()->showHideRows();
}
// tabColor
if ($pSheet->isTabColorSet()) {
$objWriter->startElement('tabColor');
$objWriter->writeAttribute('rgb', $pSheet->getTabColor()->getARGB());
$objWriter->endElement();
}
// outlinePr
$objWriter->startElement('outlinePr');
$objWriter->writeAttribute('summaryBelow', $pSheet->getShowSummaryBelow() ? '1' : '0');
$objWriter->writeAttribute('summaryRight', $pSheet->getShowSummaryRight() ? '1' : '0');
$objWriter->endElement();
// pageSetUpPr
if ($pSheet->getPageSetup()->getFitToPage()) {
$objWriter->startElement('pageSetUpPr');
$objWriter->writeAttribute('fitToPage', '1');
$objWriter->endElement();
}
$objWriter->endElement();
}
示例3: _writeSheetPr
/**
* Write SheetPr
*
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
* @param PHPExcel_Worksheet $pSheet Worksheet
* @throws Exception
*/
private function _writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
{
// sheetPr
$objWriter->startElement('sheetPr');
//$objWriter->writeAttribute('codeName', $pSheet->getTitle());
// tabColor
if ($pSheet->isTabColorSet()) {
$objWriter->startElement('tabColor');
$objWriter->writeAttribute('rgb', $pSheet->getTabColor()->getARGB());
$objWriter->endElement();
}
// outlinePr
$objWriter->startElement('outlinePr');
$objWriter->writeAttribute('summaryBelow', $pSheet->getShowSummaryBelow() ? '1' : '0');
$objWriter->writeAttribute('summaryRight', $pSheet->getShowSummaryRight() ? '1' : '0');
$objWriter->endElement();
// pageSetUpPr
if ($pSheet->getPageSetup()->getFitToPage()) {
$objWriter->startElement('pageSetUpPr');
$objWriter->writeAttribute('fitToPage', '1');
$objWriter->endElement();
}
$objWriter->endElement();
}
示例4: _writeSheetLayout
/**
* Write SHEETLAYOUT record
*/
private function _writeSheetLayout() {
if (! $this->_phpSheet->isTabColorSet ()) {
return;
}
$recordData = pack ( 'vvVVVvv', 0x0862, 0x0000, // unused
0x00000000, // unused
0x00000000, // unused
0x00000014, // size of record data
$this->_colors [$this->_phpSheet->getTabColor ()->getRGB ()], // color index
0x0000 ) // unused
;
$length = strlen ( $recordData );
$record = 0x0862; // Record identifier
$header = pack ( 'vv', $record, $length );
$this->_append ( $header . $recordData );
}