本文整理汇总了PHP中unknown::getActiveSheet方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown::getActiveSheet方法的具体用法?PHP unknown::getActiveSheet怎么用?PHP unknown::getActiveSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown
的用法示例。
在下文中一共展示了unknown::getActiveSheet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printHeaders
/**
*
* @param unknown $objPHPExcel
* @param unknown $cols
*/
private static function printHeaders($objPHPExcel, $cols)
{
$count = 1;
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 2, "Data");
foreach ($cols as $col) {
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($count++, 2, sprintf("%7s", $col));
}
}
示例2: newSheet
/**
*
* @param unknown $objPHPExcel
*/
static function newSheet($objPHPExcel, $index = -1)
{
if ($index < 0) {
$index = $objPHPExcel->getSheetCount();
}
$objPHPExcel->createSheet($index);
$objPHPExcel->setActiveSheetIndex($index);
$sheet = $objPHPExcel->getActiveSheet();
return $sheet;
}
示例3: setCENTER
/**
* 设置单元格对齐
* @param unknown $objPHPExcel
* @param unknown $CellString
* @param string $isRight 是否居右对其
*/
private function setCENTER($objPHPExcel, $CellString, $isRight = flase, $isSetBorder = false)
{
$cellStyle = $objPHPExcel->getActiveSheet()->getStyle($CellString);
$cellAlignment = $cellStyle->getAlignment();
$cellAlignment->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
if ($isRight) {
$cellAlignment->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
} else {
$cellAlignment->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
}
if ($isSetBorder) {
$cellStyle->getBorders()->getTop()->setBorderStyle(\PHPExcel_Style_Border::BORDER_THIN);
$cellStyle->getBorders()->getLeft()->setBorderStyle(\PHPExcel_Style_Border::BORDER_THIN);
$cellStyle->getBorders()->getRight()->setBorderStyle(\PHPExcel_Style_Border::BORDER_THIN);
$cellStyle->getBorders()->getBottom()->setBorderStyle(\PHPExcel_Style_Border::BORDER_THIN);
}
}