I have .xls file.
How Can i write or append content to the excel using PHP fwrite().
In waht format i write to that. When i try using fwrite its showing an error message in excel 2007
what seperator i can use? Is it possible with out excel classes
I have .xls file.
How Can i write or append content to the excel using PHP fwrite().
In waht format i write to that. When i try using fwrite its showing an error message in excel 2007
what seperator i can use? Is it possible with out excel classes
to write you can use : Spreadsheet_Excel_Writer is a tool for creating Excel files without the need for COM components
http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.php but you cant appaend to file , only to create it.
or using phpexcel (support excel 2007)
and you can append see a example :
http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=82996
if you just want/need to create a very simple table, you just need to make a *.csv-file which can be opened by excel - but not: you can't use formulas in this and you can't do any kind of formatting.
You can use the PHPExcel library, to read an existing Excel file, add new rows/columns to it, then write it back as a real Excel file.
Disclaimer: I am one of the authors of this library.
You can try and create a CSV file, like this:
name;surname;blabla
name;surname;blabla
name;surname;blabla
name;surname;blabla
Excel should eat this :)
It is convenient to use PHP CVS functions: http://php.net/manual/en/function.fputcsv.php
you can try this library http://phpexcel.codeplex.com/
or you can create .csv file for example and then import them to excel.
I wrote a simple library for exporting Excel-friendly XML files from PHP: http://github.com/elidickinson/php-export-data