Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 require_once('PEAR.php');
00035 require_once('classes/Spreadsheet/Excel/Writer/Workbook.php');
00036
00045 class Spreadsheet_Excel_Writer extends Spreadsheet_Excel_Writer_Workbook
00046 {
00053 function Spreadsheet_Excel_Writer($filename = '')
00054 {
00055 $this->_filename = $filename;
00056 $this->Spreadsheet_Excel_Writer_Workbook($filename);
00057 }
00058
00065 function send($filename)
00066 {
00067 header("Content-type: application/vnd.ms-excel");
00068 header("Content-Disposition: attachment; filename=$filename");
00069 header("Expires: 0");
00070 header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
00071 header("Pragma: public");
00072 }
00073
00084 function rowcolToCell($row, $col)
00085 {
00086 if ($col > 255) {
00087 return new PEAR_Error("Maximum column value exceeded: $col");
00088 }
00089
00090 $int = (int)($col / 26);
00091 $frac = $col % 26;
00092 $chr1 = '';
00093
00094 if ($int > 0) {
00095 $chr1 = chr(ord('A') + $int - 1);
00096 }
00097
00098 $chr2 = chr(ord('A') + $frac);
00099 $row++;
00100
00101 return $chr1.$chr2.$row;
00102 }
00103 }
00104 ?>