Skip to content

Lapinator/odsPhpGenerator

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

odsPhpGenerator

odsPhpGenerator is a library written in PHP to generate Open Document Spreadsheet (.ods)

Avatars in trending repos

Features

  • UTF-8 Encoding
  • Multi tables
  • Merge Cells
  • Formula
  • Images
  • And more

Install

By composer :

$ composer require lapinator/ods-php-generator

Example

use odsPhpGenerator\ods;
use odsPhpGenerator\odsTable;
use odsPhpGenerator\odsTableRow;
use odsPhpGenerator\odsTableCellString;

// Load library
require_once '../vendor/autoload.php';

// Create Ods object
$ods  = new ods();

// Create table named 'table 1'
$table = new odsTable('table 1');

// Create the first row
$row   = new odsTableRow();

// Create and add 2 cell 'Hello' and 'World'
$row->addCell( new odsTableCellString("Hello") );
$row->addCell( new odsTableCellString("World") );

// Attach row to table
$table->addRow($row);

// Attach talble to ods
$ods->addTable($table);

// Download the file
$ods->downloadOdsFile("HelloWorld.ods");

More examples in directory examles

About

odsPhpGenerator is library writen in PHP for generate OpenDocumentSpreadsheet.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages