bobrivers2003
Technical User
I have fair knowledge of php but zero of a Spreadsheet_Excel_Writer PEAR package I am trying to use. It writes to excel files with formats etc. and works very well if you are creating an excel file from scratch. I need to append data to an existing file. Currently it overwrites (with blank cells) my existing data and just insrts the new cell info.
The spreadsheet consists of time recordings for a task and each time the task is performed times have to be recorded, so I need to append to the bottom of the list.
The following is the code I have. Even if i put the number of the row that I want to place the data into it puts it in that row but everything else dissapears. I susspose it is creating a new file of the same name and inserting data. It needs to write to an existing file without disturbing the current data.
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// We give the path to our file here
$workbook = new Spreadsheet_Excel_Writer('times.xls');
$worksheet =& $workbook->addWorksheet('BuildData');
$worksheet->write(40, 0, '08/03/06');
$worksheet->write(40, 1, 14);
// We still need to explicitly close the workbook
$workbook->close();
?>
Any help or pointers would be greatly appreciated.
Thanks and Regards
The spreadsheet consists of time recordings for a task and each time the task is performed times have to be recorded, so I need to append to the bottom of the list.
The following is the code I have. Even if i put the number of the row that I want to place the data into it puts it in that row but everything else dissapears. I susspose it is creating a new file of the same name and inserting data. It needs to write to an existing file without disturbing the current data.
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// We give the path to our file here
$workbook = new Spreadsheet_Excel_Writer('times.xls');
$worksheet =& $workbook->addWorksheet('BuildData');
$worksheet->write(40, 0, '08/03/06');
$worksheet->write(40, 1, 14);
// We still need to explicitly close the workbook
$workbook->close();
?>
Any help or pointers would be greatly appreciated.
Thanks and Regards