phpExcel question about "AutoSizing" work sheet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Claus Mygind
    Contributor
    • Mar 2008
    • 571

    phpExcel question about "AutoSizing" work sheet

    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 ()->getColumnDimen sion('A')->setAutoSize(tr ue);

    I see this function in the documentation:

    PHPExcel_Worksh eet_ColumnDimen sion setAutoSize( [bool $pValue = false])

    Question: How do you apply this to the entire worksheet, instead of cycling through each column?
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    you better ask it to phpexcel forum

    Comment

    • Claus Mygind
      Contributor
      • Mar 2008
      • 571

      #3
      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

      Comment

      Working...