PHP Classes
elePHPant
Icontem

eiseXLSX: Read and write Excel spreadsheets in XLSX format

Recommend this page to a friend!
  Info   View files Documentation   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-02-06 (7 months ago) RSS 2.0 feedNot enough user ratingsTotal: 1,268 This week: 9All time: 2,911 This week: 86Up
Version License PHP version Categories
eisexlsx 1.7GNU General Publi...5.2XML, PHP 5, Files and Folders, Parsers
Description Author

This class can read and write Excel spreadsheets in XLSX format.

It can read and parse an existing spreadsheet file in the Microsoft Excel 2007-2011-2013 format.

The class allows to modify workbook contents by changing cell data and colors, insert or clone rows, clone or remove sheets.

The changed spreadsheet can be saved back to an Excel file and then served for download.

Recommendations

Read huge Excel file
Read excel file of min 43MB and export values to MySQL

HTML to Excel on the fly
Create Any HTML to Excel on The Fly

What is the best PHP excel read write class?
Read and write to an Excel file

Picture of Ilya Eliseev
Name: Ilya Eliseev <contact>
Classes: 1 package by
Country: Russian Federation Russian Federation
Age: 40
All time rank: 194554 in Russian Federation Russian Federation
Week rank: 104 Up6 in Russian Federation Russian Federation Up

Details

eiseXLSX

XLSX file data read-write library that operates with native cell addresses like A1 or R1C1.

This class was designed for server-side manipulations with uploaded spreadsheets in Microsoft® Excel™ 2007-2011-2013 file format – OpenXML SpereadsheetML.

Current version of this library allows to read user-uploaded file contents and to write data to preliminary uploaded template file and send it back to the user: - it allows to change existing cell data - clone rows and fill-in new rows with data - clone sheets within workbook, remove unnecessary sheets - colorization of cells.

This library offers an easiest way to make Excel™-based EDI with PHP-based information systems, for data input and output.

Users are no longer need to convert Excel™ spreadsheets to CSV and other formats, they can simply upload data to the website using their worksheets.

You can use files received from users as your website’s output document templates with 100% match of cell formats, sheet layout, design, etc. With eiseXLSX you can stop wasting your time working on output documents layout – you can just ask your customer staff to prepare documents they’d like to see in XLSX format. Then you can put these files to the server and fill them with necessary data using PHP.

Unlike other PHP libraries for XLSX files manipulation eiseXLSX is simple, compact and laconic. You don’t need to learn XLSX file format to operate with it. Just use only cell addresses in any formats (A1 and R1C1 are supported) and data from your website database. As simple as that.

Examples

Write:

  • Obtain formatted XLSX from your customer
  • Unzip it to the folder inside your project (or any other folder you like)
  • Make PHP script and include similar code inside:
<?php
include_once "eiseXLSX/eiseXLSX.php";

$xlsx = new eiseXLSX("myemptyfile.xlsx");

$xlsx->data('A4', 'Hello, world!'); // either A1 or R1C1 are accepted

$xlsx->Output("mynewfile.xlsx", "F"); // save the file
?>

Read:

<?php
include_once "eiseXLSX.php";
        
try { //give it a try to avoid any uncaught error 
      // caused by broken content of uploaded file
    $xlsx = new eiseXLSX($_FILES["fileXLSX"]["tmp_name"]);
} catch(eiseXLSX_Exception $e) {
    die($e->getMessage());
}

echo ($myData = $xlsx->data("R15C10")); //voilat!
?>

New in version 1.6:

  • method eiseXLSX::getDataValidationList($cellAddress) - returns data validation list as associative array.
  • static method eiseXLSX::checkAddressInRange() - checks whether cell address belong to given range or not.
  • method eiseXSLX::getDataByRange() - returns associative array of data in specified cell range.
  Files folder image Files  
File Role Description
Files folder imagetemplates (1 directory)
Plain text file eiseXLSX.php Class Class source
Accessible without login Plain text file README.md Doc. Auxiliary data
Plain text file zipfile.php Class Class source

  Files folder image Files  /  templates  
File Role Description
Files folder imageempty (3 directories)

  Files folder image Files  /  templates  /  empty  
File Role Description
Files folder imagedocProps (2 files)
Files folder imagexl (3 files, 3 directories)
Files folder image_rels (1 file)

  Files folder image Files  /  templates  /  empty  /  docProps  
File Role Description
  Accessible without login Plain text file app.xml Data Auxiliary data
  Accessible without login Plain text file core.xml Data Auxiliary data

  Files folder image Files  /  templates  /  empty  /  xl  
File Role Description
Files folder imagetheme (1 file)
Files folder imageworksheets (3 files)
Files folder image_rels (1 file)
  Accessible without login Plain text file sharedStrings.xml Data Auxiliary data
  Accessible without login Plain text file styles.xml Data Auxiliary data
  Accessible without login Plain text file workbook.xml Data Auxiliary data

  Files folder image Files  /  templates  /  empty  /  xl  /  theme  
File Role Description
  Accessible without login Plain text file theme1.xml Data Auxiliary data

  Files folder image Files  /  templates  /  empty  /  xl  /  worksheets  
File Role Description
  Accessible without login Plain text file sheet1.xml Data Auxiliary data
  Accessible without login Plain text file sheet2.xml Data Auxiliary data
  Accessible without login Plain text file sheet3.xml Data Auxiliary data

  Files folder image Files  /  templates  /  empty  /  xl  /  _rels  
File Role Description
  Accessible without login Plain text file workbook.xml.rels Data Auxiliary data

  Files folder image Files  /  templates  /  empty  /  _rels  
File Role Description
  Accessible without login Plain text file .rels Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:1,268
This week:9
All time:2,911
This week:86Up