Reputation: 324
I'd like to be able to output data to a spreadsheet and have been looking at various packages such as PHPExcel and some of the others listed here Alternative for PHP_excel
simply put I want to write specific text into specified cells & colour code certain cells if possible. which is the simplest form of doing so?
Upvotes: 2
Views: 248
Reputation: 38402
If you are not interested in using PHP Excel you can consider CSV format.
This links should help you. http://php.net/manual/en/function.fgetcsv.php http://www.imf.org/external/help/csv.htm
But keep in mind in csv cells or rows cant have any property like in your case colour code. An excel file can simply be saved as a csv file in excel itself
IF csv is not your liking consider Open Document format which will be eaiser to edit than excel's proprietary xml. But excel may need a plugin(OpenXML/ODF Translator Add-in for Office) to read it
Look at http://sourceforge.net/projects/ods-php/
You can also read this http://www.oasus.ca/ODS_V2.pdf
Upvotes: 0
Reputation: 212522
If you want cell formatting such as colour, then I'd certainly recommend PHPExcel... although I do have a certain developer's bias.
Despite offering a wide range of additional features, it is easy to use. You don't specify what format of Excel file you want to write, Excel BIFF file or Office Open XML: PHPExcel offers both. It's still supported (unlike many of the alternatives); and there's a lot of examples showing how to use it in the library package itself, and a helpful message board.
Upvotes: 4
Reputation: 22820
Apart from the "coloring" part, I would definitely suggest you go for CSV files (perfectly supported by ALL spreadsheet programs) :
A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal TAB or comma. Usually, all records have an identical sequence of fields.
Example :
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
Upvotes: 0