Hey Everyone - thanks for your suggestions and help
Mr. Xeeton -- we're developing on a redhat linux box running PHP 4.4
-- i'm not sure which version of PEAR is installed, but i do know that
we're getting some Open_basedir warnings/errors when trying to
access PEAR from cake.....i think it's a permissions issue.
Mr. Grant Cox -- thanks for your advice, as soon as I get into the
office I will try what you suggest. Seems to be the most promising
lead thus far, and i hope it works.
Mr. Mike Green -- ha! you're probably right, and I am trying too
hard. I just want to reiterate that we have been able to create xls
files, but there have been inconsistencies in how those file output &
render.
here are the headers we're using:
--------
header('Pragma: public');
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); //
Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); //
HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); //
HTTP/1.1
header ("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encoding: none');
header('Content-Type: application/vnd.ms-excel;'); //
This should work for IE & Opera
header("Content-type: application/x-msexcel");
header("Content-Disposition: attachment;filename=".$file.".xls");
----------
Thanks again for any suggestions you guys might have. It's greatly
appreciated.
On Oct 12, 4:43 am, Mike Green <[EMAIL PROTECTED]> wrote:
> You may be trying too hard with what you are trying to achieve
>
> Excel will take a file made up basically of tables in html.
>
> as long as you send a header like:
>
> ContentType = "application/vnd.ms-excel"
>
> then the following format for the data (note, no HTML, HEAD or other
> tags)
>
> <TABLE>
> <TR><TD>2</TD></TR>
> <TR><TD>3</TD></TR>
> <TR><TD>=SUM(A1:A2)</TD></TR>
> </TABLE>
>
> This will output a file that is perfectly acceptable by excel
>
> Mike
>
> On Oct 11, 11:34 pm, Matt Kosoy <[EMAIL PROTECTED]> wrote:
>
> > Hello.
>
> > I'm having a ton of problems trying to get cakephp to generate excel
> > files correctly, and I was wondering if anyone out there has any info/
> > suggestions.
>
> > So far I have tried the following:
>
> > 1. Re-writing a class I found on phpclasses.org (http://
> > phpclasses.promoxy.com/browse/package/2037.html)
> > this method generates the files correctly, but the problem is that
> > the xls files that are created do not open on Windows machines. This
> > class works perfect from outside of cakephp -- it's a shame.
>
> > 2. I attempted to implement this helper:
> > http://bakery.cakephp.org/articles/view/excel-xls-helper
> > using this method is ok, but for larger result sets (more than 100
> > rows returned) "bad" files are created which can not be opened by
> > Excel on any platform.
>
> > 3. The "Generate Excel spreadsheets from your database" method
> > --http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-f...
>
> > I can not make this method work for the life of me. With debugging
> > set to 0 the only result that's returned is complete gobbeldygook.
>
> > 4. I have attempted to use PEAR's spreadsheet_excel_writer
> > module, but we are hitting an open_basedir error/warning. We're
> > trying to work that out right now.
>
> > I can post code examples. Any help, suggestion, or advice would be
> > greatly appreciated. I'm tearing my eyeballs out over this.
>
> > Thanks World!!!!
>
> > -matt
>
> > 4. Using the raw PEAR 'Spreadsheet_Excel_Writer' module -- this
> > method is producing an open_basedir warning/error, and we are
> > attempting to work out the problem with our server ppl.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---