PHPExcel: Freeze first Line and Column
Question by PC Control | 2015-03-22 at 19:05
I am using PHPExcel to be able to offer an Excel export on my website with the help of PHP.
Now I would like to fix the first column and line of my Excel spreadsheet (I think that is called freezing).
Does PHPExcel support this function? Is it possible to freeze columns and/or lines with PHPExcel?
Related Topics
MySQL: Line Breaks in MySQL
Tip | 0 Comments
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
MySQL: Add new Column to a Table
Tutorial | 0 Comments
Rewrite Text Files with a fixed Line Length
Tutorial | 0 Comments
MySQL: Write current Date or Time into Column
Tutorial | 0 Comments
Quicksort: Sort two Columns
Question | 1 Answer
Repair Text Files with mixed Line Breaks
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Yes, PHPExcel is providing the function freezePane() with which you can selectively freeze lines, columns or both. khaki are some examples:
Freezing Lines
Freeze first line:
Freeze second line:
Freezing Columns
Freeze first column:
Freeze second column:
Freezing Columns and Lines
Freeze first column and first line:
Freeze fourth column and first line:
As you can see, we are passing the cell before that it should be freezed. In order to only freeze lines, you have to keep the column at "A" and in order to freeze columns, accordingly, you have to keep the line at "1". When combining this, you get the corresponding cell beyond "A" and "1".
2015-03-23 at 13:42
Thanks for your example on phpExcel, very helpful, this is what I looking for my current project, :)
For my project I used this:
$objPHPExcel->getActiveSheet()->freezePane("B8");
for my customized reporting format.
2017-03-27 at 07:41