Reputation: 3410
My PHP script have to create a multi-tabs Excel file with a report in each tab, but those reports already exists as HTML pages, so I don't want to duplicate code and work. I know I can rename a HTML file to .xls, and Excel/OpenOffice Calc will open it as a spreadsheet, but I don't know how to have severals tabs.
I do not even know if it is possible.
I already know Biffwriter and others PHP libs to create Excel file, but I am looking for a smarter solution.
Thanks, Cédric
Upvotes: 1
Views: 3424
Reputation: 624
If you don't mind serving excel 2007 files, you can do this:
Now you can use the file structure there to populate the file corresponding to each tab with the report you need. You may want to use them as templates, keep the same code and render different files depending on whether you generate the html report of the excel report.
In the end, zip up the entire directory structure and serve it with an xlsx extension.
Upvotes: 1
Reputation: 4175
Please check the URLS of a library and turorials from IBM and
Upvotes: 0
Reputation: 69981
Pear Excel Spreadsheet Writer has a function to create new Worksheets if thats what you are looking for.
Upvotes: 1