for ($char = 'A'; $char <= 'Z'; $char++) {
$objPHPExcel->getActiveSheet()->setCellValue($char.'5','40');
}
for ($i=1;$i<=100;$i++){
$objPHPExcel->getActiveSheet()->setCellValue('A'.$i,generateRandomString());
}
$objPHPExcel->getActiveSheet()->freezePane('B');
// Write the PHPExcel object to browser as HTML
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
$objWriter->save('php://output');
$objPHPExcel->getActiveSheet()->freezePane('B');
Freeze not happened for the " A " (First column) column.
Attached screen shot FYI. Freeze not happened for the " A " (First column) column. When i scroll COL A not freeze, col A also hidding.
the freezePane() coordinate should be a cell reference for the top-left cell of the non-frozen part of the worksheet, so
$objPHPExcel->getActiveSheet()->freezePane('B2');
tells Excel to freeze rows above row 2, and to the left of column "B"... i.e. row 1 and column "A" will be frozen.
Try this:
$ColumnCount=0;
$RowIndex=8;
$objPHPExcel->getActiveSheet()->freezePaneByColumnAndRow($ColumnCount, $RowIndex);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With