Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 915 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 liveuser 1
<?php
2
/*
3
 
4
ods-php a library to read and write ods files from php.
5
 
6
This library has been forked from eyeOS project and licended under the LGPL3
7
terms available at: http://www.gnu.org/licenses/lgpl-3.0.txt (relicenced
8
with permission of the copyright holders)
9
 
10
Copyright: Juan Lao Tebar (juanlao@eyeos.org) and Jose Carlos Norte (jose@eyeos.org) - 2008 
11
 
12
https://sourceforge.net/projects/ods-php/
13
 
14
*/
15
 
16
 
17
include("ods.php"); //include the class and wrappers
18
$object = newOds(); //create a new ods file
19
$object->addCell(0,0,0,1,'float'); //add a cell to sheet 0, row 0, cell 0, with value 1 and type float
20
$object->addCell(0,0,1,2,'float'); //add a cell to sheet 0, row 0, cell 1, with value 1 and type float
21
$object->addCell(0,1,0,1,'float'); //add a cell to sheet 0, row 1, cell 0, with value 1 and type float
22
$object->addCell(0,1,1,2,'float'); //add a cell to sheet 0, row 1, cell 1, with value 1 and type float
23
saveOds($object,'/tmp/new.ods'); //save the object to a ods file
24
 
25
$object=parseOds('/tmp/new.ods'); //load the ods file
26
$object->editCell(0,0,0,25); //change the value for the cell in sheet 0, row 0, cell 0, to 25
27
saveOds($object,'/tmp/new2.ods'); //save with other name
28
 
29
 
30
?>