Is there any alternative for PHP_excel which can "Export to XLSX/XLS" file in a customized format?
This is a General Reference question for the php tag
For Writing Excel
PEAR's PHP_Excel_Writer (xls only)
php_writeexcel from Bettina
Attack (xls only)
XLS File Generator commercial and xls only
Excel Writer for PHP from Sourceforge (spreadsheetML only)
Ilia Alshanetsky's Excel extension now on github (xls and xlsx, and requires commercial libXL component)
PHP's COM extension (requires a COM enabled spreadsheet program such as MS Excel or OpenOffice Calc running on the server)
The Open Office alternative to COM (PUNO) (requires Open Office installed on the server with Java support enabled)
PHP-Export-Data by Eli Dickinson (Writes SpreadsheetML - the Excel 2003 XML format, and CSV)
Oliver Schwarz's php-excel (SpreadsheetML)
Oliver Schwarz's original version of php-excel (SpreadsheetML)
excel_xml (SpreadsheetML, despite its name)... link reported as broken
The tiny-but-strong (tbs) project includes the OpenTBS tool for creating OfficeOpenXML documents (OpenDocument and OfficeOpenXML formats)
SimpleExcel Claims to read and write Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats
KoolGrid xls spreadsheets only, but also doc and pdf
PHP_XLSXWriter OfficeOpenXML
PHP_XLSXWriter_plus OfficeOpenXML, fork of PHP_XLSXWriter
php_writeexcel xls only (looks like it's based on PEAR SEW)
spout OfficeOpenXML (xlsx) and CSV
Slamdunk/php-excel (xls only) looks like an updated version of the old PEAR Spreadsheet Writer
For Reading Excel
php-spreadsheetreader reads a variety of formats (.xls, .ods and .csv)
PHP-ExcelReader (xls only)
PHP_Excel_Reader (xls only)
PHP_Excel_Reader2 (xls only)
XLS File Reader Commercial and xls only
SimpleXLSX From the description it reads xlsx files , though the author constantly refers to xls
PHP Excel Explorer Commercial and xls only
Ilia Alshanetsky's Excel extension now on github (xls and xlsx, and requires commercial libXL component)
PHP's COM extension (requires a COM enabled spreadsheet program such as MS Excel or OpenOffice Calc running on the server)
The Open Office alternative to COM (PUNO) (requires Open Office installed on the server with Java support enabled)
Nuovo's spreadsheet-reader (csv, xls, xlsx, and ods)
SimpleExcel Claims to read and write Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats
PHPExcleReader Is just a ZIP with an old version of PHPExcel
Akeneo Labs Spreadsheet Parser OfficeOpenXML (.xlsx) and CSV files
spout OfficeOpenXML (xlsx) and CSV
xhook's php-spreadsheetreader Claims to do most formats
A new C++ Excel extension for PHP, though you'll need to build it yourself, and the docs are pretty sparse when it comes to trying to find out what functionality (I can't even find out from the site what formats it supports, or whether it reads or writes or both.... I'm guessing both) it offers is phpexcellib from SIMITGROUP.
All claim to be faster than PHPExcel from codeplex or from github, but (with the exception of COM, PUNO Ilia's wrapper around libXl and spout) they don't offer both reading and writing, or both xls and xlsx; may no longer be supported; and (while I haven't tested Ilia's extension) only COM and PUNO offers the same degree of control over the created workbook.
I wrote a very simple class for exporting to "Excel XML" aka SpreadsheetML. It's not quite as convenient for the end user as XSLX (depending on file extension and Excel version, they may get a warning message), but it's a lot easier to work with than XLS or XLSX.
http://github.com/elidickinson/php-export-data
Related
I'm importing a file with .dot extension but I get a error:
ZipArchive::locateName(): Invalid or uninitialized Zip object
The weird thing is that a .dotx file does work. Is .dot not supported anymore?
From its README.md:
The current version of PHPWord supports Microsoft Office Open XML (OOXML or OpenXML), OASIS Open Document Format for Office Applications (OpenDocument or ODF), Rich Text Format (RTF), HTML, and PDF.
Office Open XML is the newer Microsoft Office file format consisting of a zip archive containing several other files. .dotx files are Office Open XML files.
In contrast, .dot files are not zip archives. They're for legacy versions of Microsoft Office.
Office Open XML is an open specification, making it much easier to use than legacy Office formats by third-party applications. This is probably one of the reasons that PHPWord supports it but doesn't support legacy file types.
I suggest saving your .dot file as a .dotx file in a modern version of Word and then working with the .dotx version of the file in your PHP code.
I have heard of PHP Excel inorder to work with excel documents in PHP. However do I require MS Office on the Ubuntu System inorder to work and serve excel documents? Or can the PHP Excel extension work ad hoc with serving excel documents in any system?
PHPExcel is pure PHP, it has no requirement to access MS Office in any way
From the readme of the PHPExcel repo on github
PHPExcel is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, Libre/OpenOffice Calc .ods, Gnumeric, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP.
Requirements
PHP version 5.2.0 or higher
PHP extension php_zip enabled (required if you need PHPExcel to handle .xlsx .ods or .gnumeric files)
PHP extension php_xml enabled
PHP extension php_gd2 enabled (optional, but required for exact column width autocalculation)
I am trying to edit my existing .xls Excel file. But i can't find the proper way to edit existing .xls excel file.
I had used PHPEXCEL for reading the .xls file and then writing the .xls file. But in that I lost some excel functionality like 'macro', 'vb form' from existing .xls file.
In my case, I need to update my Excel file day by day. So currently I am using PHPEXCEL, first I need to read Excel then write it with a new record.
So I am finding the way to edit existing .xls file with my new record.
Please share your idea if you find.
If you need support for macros and forms, then you're pretty limited in your choices. There's only 3 options available:
Ilia Alshanetsky's Excel extension now on github (requires commercial libXL component)
PHP's COM extension (requires a COM enabled spreadsheet program such as MS Excel or OpenOffice Calc running on the server)
The Open Office alternative to COM (PUNO) (requires Open/Libre Office installed on the server with Java support enabled)
I'm developing a system where users will be uploading documents. It will only support MS Office files 2003 and earlier so it currently barfs if the user uploads any of the x files (docx, xlsx, pptx).
I've found PHPWord in another SO question, but this does the exact opposite of what I need and also is still in what looks to be early beta.
Worst case scenario, are there any good libraries for conversion from these same MSO-X formats to PDFs?
My application generates some .xls files and until now I was using PHPExcel lib. One of the SO has recommend me to use this approach. The problem is that I have to use some .xls templates and to append some data to them.
Who can help me with some pointers. I don't get how xlsBOF() and xlsEOF() works or have to work in my case.
If the approach you use right now works for you, don't bother with anything else.
PHPExcel writes XML files (or more accurately zip files containing XML files), in the new Excel 2007 format. For this reason, it's not compatible with older office versions (unless you install the compatibility plugin in the older office).
What this code does is write a binary XLS file in Excel 97 (BIFF8) format. It's a bit of a hack though. This won't deal correctly with unicode issues and so on. xlsBOF writes the binary header of the XLS file, and xlsEOF the footer.
If you want to write binary XLS files, you're better off using PEAR Excel Writer. I have mixed experiences with that. It gets the job done, but to use it with unicode you have to look through the bug list for a few patches that fix BIFF8 format bugs (the package is poorly maintained). It's still better than the code you linked to though.
Update: PHPExcel supports export as Excel 97 also. I remember that it used to be limited to the office 2007 file format, but apparently currently it's not. So I would recommend using PHPExcel.