How to set PHPExcel to write a file and use grid lines?

I am trying to set print options for an excel file in PHPExcel. I work from packaged API documents (version 1.7.7), but cannot find any methods for this. Have I missed the setup somewhere?

This option is located in MS Excel under "Print"> "Page Setup"> "Sheet".

+4
source share
2 answers
$objPHPExcel->getActiveSheet()->setPrintGridlines(TRUE); 

EDIT

setPrintGridlines () determines whether grids should be displayed around cells when printing a sheet from MS Excel; defaults to false. setShowGridlines () determines whether grids should be displayed around cells when the spreadsheet is displayed in the MS EXcel GUI; default is TRUE;

+6
source

I found the one I was looking for. This was in the Worksheet class, not in the page setup class, as I thought before. For those looking to the future, this is the method you need:

 PHPExcel_Worksheet setPrintGridlines( [boolean $pValue = false]) 

There are two very similar functions: setPrintGridlines and setShowGridlines. I'm not quite sure about that. Can anyone enlighten me?

0
source

All Articles