PHP Classes

XLS Class: Compose and generate Excel XLS spreadsheet files

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 55%Total: 2,016 All time: 1,947 This week: 263Up
Version License PHP version Categories
xls-class 1.0GNU General Publi...5PHP 5, Files and Folders
Description 

Author

This class can be used to compose and generate Excel XLS spreadsheet files.

It can add cells to the definition of a spreadsheet by specifying the position of the cell and its contents. The contents may be regular text or even formulas.

The composed spreadsheet can be served for download or saved to a given file in Excel XLS format.

Picture of Prithwiraj Bose
  Performance   Level  
Name: Prithwiraj Bose <contact>
Classes: 1 package by
Country: United Kingdom
Age: 37
All time rank: 149568 in United Kingdom
Week rank: 312 Up8 in United Kingdom Up

Example

<?php
include("xls.class.php");
$xl = new xls();

//adding new cells to the spreadsheet
//syntax: object_of_xls_class->add_cell("column_number:row_number","cell_content");
$xl->add_cell("1:1","Name");
$xl->add_cell("1:2","Rahul");
$xl->add_cell("1:3","Tina");
$xl->add_cell("2:1","Amount");
$xl->add_cell("2:2","36");
$xl->add_cell("2:3","24");
$xl->add_cell("1:4","Total");

//you can apply formula to a cell
$xl->add_cell("2:4","=sum(B2:B3)");

//force download the file with specified name
$xl->execute("myfile.xls");
?>


  Files folder image Files  
File Role Description
Files folder imagexls.class (2 files)

  Files folder image Files  /  xls.class  
File Role Description
  Plain text file index.php Example Example File
  Plain text file xls.class.php Class The XLS PHP Class File

 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,016
This week:0
All time:1,947
This week:263Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:55%StarStarStar
Rank:1880