Puoi fare qualche esempio? Sto cercando di fare come lei ha detto, ma c'è qualche cosa di sbagliato
On May 27, 9:46 am, Martin Westin <[email protected]> wrote: > There is a very very simple way to exportExcel-files without any > special libraries or classes. > > The cheat, and it is a cheat but who cares whenExceldoesn't :), is > to export a html table and call it anexcelfile. That's it. Simple, > right? > > • Point to an URL with an "xls" file extension (use parseExtensions is > a good idea). "example.com/stats/weekly.xls" > > • Set the output headers. RequestHandler wants: > $this->RequestHandler->setContent('xls', 'application/vnd.ms-excel'); > > • Output a table in your view. Do not output a html page. Just the > table will do. Please add some 90's formatting to the table to get > some borders. Add any h# tags and p tags before and after the table to > add some information and labeling. > > I did not learn this until recently when I was sent anexcel-file that > myexcelimport could not read. At first I thought it was some new > xlsx variation that my mac could not read but it turned out it was a > html table masked as anexcelfile. > > I thought this might be useful to some of you. It is a lot less > painful than mostexcellibraries when you just want to export some > stats page asexcel. Your view will probably already have a table of > data. > > /Martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
