How to use the setZoom function when writing an Excel5 file ?

Topics: Developer Forum, User Forum
Nov 12, 2008 at 10:49 PM
Hi all,

How can I use the setZoom function when writing an Excel5 file ?
This function is available at the PHPExcel_Writer_Excel5_Worksheet class level but I don't succeed in using it.
Any advice.

Regards,

Nicoanto
Developer
Nov 12, 2008 at 11:07 PM
Please try this:

$excel = new PHPExcel();

$sheet = $excel->getActiveSheet();
$sheet->getSheetView()->setZoomScale(300);

$writer = new PHPExcel_Writer_Excel5($excel);
$writer->save('test.xls');

Important! You need to use latest source (PHPExcel 1.6.4 will not work). Download from here:

http://www.codeplex.com/PHPExcel/SourceControl/ListDownloadableCommits.aspx
Nov 13, 2008 at 8:35 AM
I just tried the code you gave me and it is working with the last PHPExcel commits.
But when will it be included in an official release ?

Regards,

Nicoanto
Developer
Nov 13, 2008 at 1:32 PM
Will be included in PHPExcel 1.6.5
http://www.codeplex.com/PHPExcel/WorkItem/View.aspx?WorkItemId=7993

With an expected 2 month release cycle, that will late December 2008. In most cases latest commit will be slightly better than latest official release, so just use it for your project!