本文整理汇总了PHP中PHPExcel::getActiveSheetIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel::getActiveSheetIndex方法的具体用法?PHP PHPExcel::getActiveSheetIndex怎么用?PHP PHPExcel::getActiveSheetIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel
的用法示例。
在下文中一共展示了PHPExcel::getActiveSheetIndex方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSimple
public function testSimple()
{
$data = ['ROOT' => ['LEVEL1' => [['LEVEL1_CAPTION' => '1'], ['LEVEL1_CAPTION' => '2']]]];
$namedRange = $this->output->getNamedRange('ROOT');
$this->sut->write($data, $namedRange);
$this->output->setActiveSheetIndexByName('TEMPLATE');
$this->output->removeSheetByIndex($this->output->getActiveSheetIndex());
$excelWriter = \PHPExcel_IOFactory::createWriter($this->output, 'Excel2007');
$excelWriter->save(__DIR__ . '/../metadata/output/verticalrangewritertest.xlsx');
}
示例2: _writeBookViews
/**
* Write BookViews
*
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
* @param PHPExcel $pPHPExcel
* @throws PHPExcel_Writer_Exception
*/
private function _writeBookViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
{
// bookViews
$objWriter->startElement('bookViews');
// workbookView
$objWriter->startElement('workbookView');
$objWriter->writeAttribute('activeTab', $pPHPExcel->getActiveSheetIndex());
$objWriter->writeAttribute('autoFilterDateGrouping', '1');
$objWriter->writeAttribute('firstSheet', '0');
$objWriter->writeAttribute('minimized', '0');
$objWriter->writeAttribute('showHorizontalScroll', '1');
$objWriter->writeAttribute('showSheetTabs', '1');
$objWriter->writeAttribute('showVerticalScroll', '1');
$objWriter->writeAttribute('tabRatio', '600');
$objWriter->writeAttribute('visibility', 'visible');
$objWriter->endElement();
$objWriter->endElement();
}
示例3: writeWindow1
/**
* Write Excel BIFF WINDOW1 record.
*/
private function writeWindow1()
{
$record = 0x3d;
// Record identifier
$length = 0x12;
// Number of bytes to follow
$xWn = 0x0;
// Horizontal position of window
$yWn = 0x0;
// Vertical position of window
$dxWn = 0x25bc;
// Width of window
$dyWn = 0x1572;
// Height of window
$grbit = 0x38;
// Option flags
// not supported by PHPExcel, so there is only one selected sheet, the active
$ctabsel = 1;
// Number of workbook tabs selected
$wTabRatio = 0x258;
// Tab to scrollbar ratio
// not supported by PHPExcel, set to 0
$itabFirst = 0;
// 1st displayed worksheet
$itabCur = $this->phpExcel->getActiveSheetIndex();
// Active worksheet
$header = pack("vv", $record, $length);
$data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio);
$this->append($header . $data);
}
示例4: getDayTest
function getDayTest(PHPExcel $objPHPExcel, PHPExcel_Worksheet $sheet, $col = 'A', $row = 1, $day = 'ПОНЕДЕЛЬНИК')
{
$b = false;
$index_sheet = $objPHPExcel->getActiveSheetIndex();
$rowHiestIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn($row));
for ($i = 0; $i <= $rowHiestIndex; $i++) {
$cell_value = $this->getValueMergedCell($objPHPExcel, $index_sheet, $this->arr_merged_allCells, $i, $row);
if ($cell_value == $day) {
return $b = true;
}
}
if (!$b) {
$colHiestIndex = $sheet->getHighestRow($col);
for ($i = 0; $i <= $colHiestIndex; $i++) {
$cell_value = $this->getValueMergedCell($objPHPExcel, $index_sheet, $this->arr_merged_allCells, $col, $i);
if ($cell_value == $day) {
return $b = true;
}
}
}
return $b;
}
示例5: array
$objPHPExcel->getActiveSheet()->getColumnDimension($coluna)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getStyle($coluna . '1')->getFont()->setBold(true);
}
}
$colunas = array('A' => 'CAMPUS', 'B' => 'CURSO', 'C' => 'LOCAL DE PROVA', 'D' => 'INSCRITO', 'E' => 'N. INSCRICAO', 'F' => 'CPF', 'G' => 'RG', 'H' => 'ORGAO EXPEDIDOR', 'I' => 'UF', 'J' => 'DATA DE EXPEDICAO', 'K' => 'NACIONALIDADE', 'L' => 'DATA DE NASCIMENTO', 'M' => 'SEXO', 'N' => 'ENDERECO', 'O' => 'CEP', 'P' => 'CIDADE', 'Q' => 'ESTADO', 'R' => 'TELEFONE', 'S' => 'CELULAR', 'T' => 'EMAIL', 'U' => 'ESTADO CIVIL', 'V' => 'NECESSIDADE ESPECIAL', 'W' => 'DESCRICAO NECESSIDADE ESPECIAL', 'X' => 'ISENCAO DE TAXA', 'Y' => 'CONDICOES ESPECIAIS PARA REALIZACAO DA PROVA', 'Z' => 'DESCRICAO CONDICOES ESPECIAIS PARA REALIZACAO DA PROVA', 'AA' => 'CONCORRE AS VAGAS DESTINADAS A CANDIDATOS COM NECESSIDADES ESPECIAIS');
$query = $banco->ExecutaQueryGenerica($sql);
$numResults = mysql_num_rows($query);
$linha = 2;
$campus_id = null;
while ($row = mysql_fetch_assoc($query)) {
$val = array_values($row);
if ($campus_id != $val[0]) {
$campus_id = $val[0];
if ($campus_id > 1 && $numResults > 1) {
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($objPHPExcel->getActiveSheetIndex() + 1);
}
$objPHPExcel->getActiveSheet()->setTitle(removeAcentos($val[1]));
setCabecalho($objPHPExcel, $colunas);
$linha = 2;
}
$col = 1;
foreach ($colunas as $coluna => $valor) {
if ($val[$col] == null) {
$objPHPExcel->getActiveSheet()->SetCellValue($coluna . $linha, '---');
} else {
$objPHPExcel->getActiveSheet()->SetCellValue($coluna . $linha, utf8_encode($val[$col]));
}
$col++;
}
$linha++;
示例6: get_active_worksheet
/**
* Get the currently active sheet
*
* @return PHPExcel_Worksheet
*/
public function get_active_worksheet()
{
return $this->_worksheets[$this->_spreadsheet->getActiveSheetIndex()];
}
示例7: clean
protected function clean()
{
$this->output->setActiveSheetIndexByName('TEMPLATE');
$this->output->removeSheetByIndex($this->output->getActiveSheetIndex());
}