Re: Structures_DataGrid_Renderer_XLS: I just get empty files

From: Date: Tue, 27 Feb 2007 17:48:47 +0000
Subject: Re: Structures_DataGrid_Renderer_XLS: I just get empty files
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26685@lists.php.net to get a copy of this message
Mark Wiesemann schrieb:
Hi Markus, Markus Ernst wrote:
Thank you for your input! I updated all kinds of PEAR packages that could have any impact, with no success. Anyway as you wrote it worked for you, I tried to understand what happens in those Excel and OLE classes and finally found the reason: A Safe Mode restriction prevented the OLE File class from creating a temporary file! So here's the Safe Mode proof version of my code (csv part removed):
[...]
$workbook =& $renderer->getContainer(); $workbook->setTempDir($_SERVER['DOCUMENT_ROOT'].'/temp/');
[...] I now remember that I had the same problem sometime last year. Can you please write a feature request? I think it would be a good idea to add a new option for the temporary directory and to document the need to set this option when safe_mode is enabled.
Ok I have done this. Now with my real world data I still have the *** ERROR IN SST *** problem that is already described in a bug for Spreadsheet_Excel_Writer, but that should (according to a comment in the bug report) be solved in the actual version when setting setVersion(8). Anyway the problem seems to persist. Is there a known solution to this now? Or do I just forget something? Here's the code, that works for small data, but breaks with bigger amounts (5-column person list, breaks from line 89): <?php $options = array('encoding' => 'utf-8', 'filename' => 'test.xls'); $renderer =& $datagrid->setRenderer(DATAGRID_RENDER_XLS, $options); $workbook =& $renderer->getContainer(); $workbook->setTempDir('path/to/dir/'); $workbook->setVersion(8); $datagrid->render($renderer); ?>

« previous php.pear.general (#26685) next »