• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Build excel file in php

Any advice on this? I have data from a database that I want to package into Excel.

If anyone has done this, I'd love advice. Or if anyone knows of a good project that I could leverage off of, that would be great.

FWIW, this data is simple. I just need to get the values I have into the appropriate cells. No color formatting or anything along those lines.
 
An alternative might be to put the data from the database into a CSV file, which will be converted into a spreadsheet when opened in Excel.
 
I might try using a library. And I am considering a tab delimited CVS file. I want a simple solution for a valid XLS file and it is not documented anywhere.
 
^ True, but for Excel Microsoft seems to redefine it as "a text file with field separators" 🙂

The XLS file format is nasty binary goop. I had to write import / export code for it in C++ years ago at another job and it was no fun.

If you decide not to use the easier comma or tab delimited text format, the XLSX format might be easier since it's a Zip archive of XML and other bits.
 
I saw that pear project. I'll give it a shot and see what happens.

The CSV name indicates the use of the comma to separate data fields, but "CSV" is often applied to files using other delimiters. In common usage almost any delimiter-separated text data may be referred to as a CSV file. RFC4180 tries to formalize the CSV format. IMHO, CSV is like saying Kleenex. Kleenex is a brand but even generic facial tissues are aften referred to as Kleenex.
 
Back
Top