By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

phpExcel question about "AutoSizing" work sheet

Claus Mygind
100+
P: 571
I am using the PHPExcel add-on class for php. It should allow you to programatically do everything you can do in a MS Excel spreadsheet.

I know in excel you can select the entire worksheet and then right click between any two columns and it will autosize the entire sheet. I am looking for that same function in phpExcel.


I am a little fuzzy on how to write the code for autosizing the columns in the spreadsheet.

I know this code will autosize column A

$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);

I see this function in the documentation:

PHPExcel_Worksheet_ColumnDimension setAutoSize( [bool $pValue = false])

Question: How do you apply this to the entire worksheet, instead of cycling through each column?
Apr 19 '12 #1

✓ answered by Claus Mygind

Actually the answer I found in another news group was don't use that feature because it is imperfect as of yet. If you can predict the max size better setting then to set the sizing for each column

Share this Question
Share on Google+
2 Replies


100+
P: 1,059
you better ask it to phpexcel forum
Apr 19 '12 #2

Claus Mygind
100+
P: 571
Actually the answer I found in another news group was don't use that feature because it is imperfect as of yet. If you can predict the max size better setting then to set the sizing for each column
Apr 23 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.