ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
Spreadsheet_Excel_Writer Class Reference
+ Inheritance diagram for Spreadsheet_Excel_Writer:
+ Collaboration diagram for Spreadsheet_Excel_Writer:

Public Member Functions

 Spreadsheet_Excel_Writer ($filename= '')
 The constructor.
 send ($filename)
 Send HTTP headers for the Excel file.
 Spreadsheet_Excel_Writer ($filename= '')
 The constructor.
 send ($filename)
 Send HTTP headers for the Excel file.
- Public Member Functions inherited from Spreadsheet_Excel_Writer_Workbook
 Spreadsheet_Excel_Writer_Workbook ($filename)
 Class constructor.
 close ()
 Calls finalization methods.
 sheets ()
 An accessor for the _worksheets[] array Returns an array of the worksheet objects in a workbook It actually calls to worksheets()
 worksheets ()
 An accessor for the _worksheets[] array.
 setVersion ($version)
 Sets the BIFF version.
 setCountry ($code)
 Set the country identifier for the workbook.
addWorksheet ($name= '')
 Add a new worksheet to the Excel workbook.
addFormat ($properties=array())
 Add a new format to the Excel workbook.
addValidator ()
 Create new validator.
 setCustomColor ($index, $red, $green, $blue)
 Change the RGB components of the elements in the colour palette.
 _setPaletteXl97 ()
 Sets the colour palette to the Excel 97+ default.
 _storeWorkbook ()
 Assemble worksheets into a workbook and send the BIFF data to an OLE storage.
 setTempDir ($dir)
 Sets the temp dir used for storing the OLE file.
 _storeOLEFile ()
 Store the workbook in an OLE container.
 _calcSheetOffsets ()
 Calculate offsets for Worksheet BOF records.
 _storeAllFonts ()
 Store the Excel FONT records.
 _storeAllNumFormats ()
 Store user defined numerical formats i.e.
 _storeAllXfs ()
 Write all XF records.
 _storeAllStyles ()
 Write all STYLE records.
 _storeExterns ()
 Write the EXTERNCOUNT and EXTERNSHEET records.
 _storeNames ()
 Write the NAME record to define the print area and the repeat rows and cols.
 _storeCodepage ()
 Stores the CODEPAGE biff record.
 _storeWindow1 ()
 Write Excel BIFF WINDOW1 record.
 _storeBoundsheet ($sheetname, $offset)
 Writes Excel BIFF BOUNDSHEET record.
 _storeSupbookInternal ()
 Write Internal SUPBOOK record.
 _storeExternsheetBiff8 ()
 Writes the Excel BIFF EXTERNSHEET record.
 _storeStyle ()
 Write Excel BIFF STYLE records.
 _storeNumFormat ($format, $ifmt)
 Writes Excel FORMAT record for non "built-in" numerical formats.
 _storeDatemode ()
 Write DATEMODE record to indicate the date system in use (1904 or 1900).
 _storeExterncount ($cxals)
 Write BIFF record EXTERNCOUNT to indicate the number of external sheet references in the workbook.
 _storeExternsheet ($sheetname)
 Writes the Excel BIFF EXTERNSHEET record.
 _storeNameShort ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 Store the NAME record in the short format that is used for storing the print area, repeat rows only and repeat columns only.
 _storeNameLong ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 Store the NAME record in the long format that is used for storing the repeat rows and columns when both are specified.
 _storeCountry ()
 Stores the COUNTRY record for localization.
 _storePalette ()
 Stores the PALETTE biff record.
 _calculateSharedStringsSizes ()
 Calculate Handling of the SST continue blocks is complicated by the need to include an additional continuation byte depending on whether the string is split between blocks or whether it starts at the beginning of the block.
 _storeSharedStringsTable ()
 Write all of the workbooks strings into an indexed array.
 Spreadsheet_Excel_Writer_Workbook ($filename)
 Class constructor.
 close ()
 Calls finalization methods.
 sheets ()
 An accessor for the _worksheets[] array Returns an array of the worksheet objects in a workbook It actually calls to worksheets()
 worksheets ()
 An accessor for the _worksheets[] array.
 setVersion ($version)
 Sets the BIFF version.
 setCountry ($code)
 Set the country identifier for the workbook.
addWorksheet ($name= '')
 Add a new worksheet to the Excel workbook.
addFormat ($properties=array())
 Add a new format to the Excel workbook.
addValidator ()
 Create new validator.
 setCustomColor ($index, $red, $green, $blue)
 Change the RGB components of the elements in the colour palette.
 _setPaletteXl97 ()
 Sets the colour palette to the Excel 97+ default.
 _storeWorkbook ()
 Assemble worksheets into a workbook and send the BIFF data to an OLE storage.
 _storeOLEFile ()
 Store the workbook in an OLE container.
 _calcSheetOffsets ()
 Calculate offsets for Worksheet BOF records.
 _storeAllFonts ()
 Store the Excel FONT records.
 _storeAllNumFormats ()
 Store user defined numerical formats i.e.
 _storeAllXfs ()
 Write all XF records.
 _storeAllStyles ()
 Write all STYLE records.
 _storeExterns ()
 Write the EXTERNCOUNT and EXTERNSHEET records.
 _storeNames ()
 Write the NAME record to define the print area and the repeat rows and cols.
 _storeCodepage ()
 Stores the CODEPAGE biff record.
 _storeWindow1 ()
 Write Excel BIFF WINDOW1 record.
 _storeBoundsheet ($sheetname, $offset)
 Writes Excel BIFF BOUNDSHEET record.
 _storeSupbookInternal ()
 Write Internal SUPBOOK record.
 _storeExternsheetBiff8 ()
 Writes the Excel BIFF EXTERNSHEET record.
 _storeStyle ()
 Write Excel BIFF STYLE records.
 _storeNumFormat ($format, $ifmt)
 Writes Excel FORMAT record for non "built-in" numerical formats.
 _storeDatemode ()
 Write DATEMODE record to indicate the date system in use (1904 or 1900).
 _storeExterncount ($cxals)
 Write BIFF record EXTERNCOUNT to indicate the number of external sheet references in the workbook.
 _storeExternsheet ($sheetname)
 Writes the Excel BIFF EXTERNSHEET record.
 _storeNameShort ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 Store the NAME record in the short format that is used for storing the print area, repeat rows only and repeat columns only.
 _storeNameLong ($index, $type, $rowmin, $rowmax, $colmin, $colmax)
 Store the NAME record in the long format that is used for storing the repeat rows and columns when both are specified.
 _storeCountry ()
 Stores the COUNTRY record for localization.
 _storePalette ()
 Stores the PALETTE biff record.
 _calculateSharedStringsSizes ()
 Calculate Handling of the SST continue blocks is complicated by the need to include an additional continuation byte depending on whether the string is split between blocks or whether it starts at the beginning of the block.
 _storeSharedStringsTable ()
 Write all of the workbooks strings into an indexed array.
- Public Member Functions inherited from Spreadsheet_Excel_Writer_BIFFwriter
 Spreadsheet_Excel_Writer_BIFFwriter ()
 Constructor.
 _setByteOrder ()
 Determine the byte order and store it as class data to avoid recalculating it for each call to new().
 _prepend ($data)
 General storage function.
 _append ($data)
 General storage function.
 _storeBof ($type)
 Writes Excel BOF record to indicate the beginning of a stream or sub-stream in the BIFF file.
 _storeEof ()
 Writes Excel EOF record to indicate the end of a BIFF stream.
 _addContinue ($data)
 Excel limits the size of BIFF records.
 Spreadsheet_Excel_Writer_BIFFwriter ()
 Constructor.
 _setByteOrder ()
 Determine the byte order and store it as class data to avoid recalculating it for each call to new().
 _prepend ($data)
 General storage function.
 _append ($data)
 General storage function.
 _storeBof ($type)
 Writes Excel BOF record to indicate the beginning of a stream or sub-stream in the BIFF file.
 _storeEof ()
 Writes Excel EOF record to indicate the end of a BIFF stream.
 _addContinue ($data)
 Excel limits the size of BIFF records.
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor.
 _PEAR ()
 Destructor (the emulated type of...).
getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them.
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes.
 isError ($data, $code=null)
 Tell whether a value is a PEAR error.
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled.
 expectError ($code= '*')
 This method is used to tell which errors you expect to get.
 popExpect ()
 This method pops one element off the expected error codes stack.
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available.
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack.
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied.
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options.
 staticPushErrorHandling ($mode, $options=null)
 staticPopErrorHandling ()
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack.
 popErrorHandling ()
 Pop the last error handler used.
 loadExtension ($ext)
 OS independant PHP extension load.

Static Public Member Functions

 rowcolToCell ($row, $col)
 Utility function for writing formulas Converts a cell's coordinates to the A1 format.
 rowcolToCell ($row, $col)
 Utility function for writing formulas Converts a cell's coordinates to the A1 format.

Additional Inherited Members

- Data Fields inherited from Spreadsheet_Excel_Writer_Workbook
 $_filename
 $_parser
 $_1904
 $_activesheet
 $_firstsheet
 $_selected
 $_xf_index
 $_fileclosed
 $_biffsize
 $_sheetname
 $_tmp_format
 $_worksheets
 $_sheetnames
 $_formats
 $_palette
 $_url_format
 $_codepage
 $_country_code
 $_tmp_dir
 $_string_sizeinfo_size

Detailed Description

Definition at line 45 of file Writer.php.

Member Function Documentation

Spreadsheet_Excel_Writer::rowcolToCell (   $row,
  $col 
)
static

Utility function for writing formulas Converts a cell's coordinates to the A1 format.

public

Parameters
integer$rowRow for the cell to convert (0-indexed).
integer$colColumn for the cell to convert (0-indexed).
Returns
string The cell identifier in A1 format

Definition at line 84 of file Writer.php.

References $row.

{
if ($col > 255) { //maximum column value exceeded
return new PEAR_Error("Maximum column value exceeded: $col");
}
$int = (int)($col / 26);
$frac = $col % 26;
$chr1 = '';
if ($int > 0) {
$chr1 = chr(ord('A') + $int - 1);
}
$chr2 = chr(ord('A') + $frac);
$row++;
return $chr1.$chr2.$row;
}
Spreadsheet_Excel_Writer::rowcolToCell (   $row,
  $col 
)
static

Utility function for writing formulas Converts a cell's coordinates to the A1 format.

public

Parameters
integer$rowRow for the cell to convert (0-indexed).
integer$colColumn for the cell to convert (0-indexed).
Returns
string The cell identifier in A1 format

Definition at line 84 of file Writer.php.

References $row.

{
if ($col > 255) { //maximum column value exceeded
return new PEAR_Error("Maximum column value exceeded: $col");
}
$int = (int)($col / 26);
$frac = $col % 26;
$chr1 = '';
if ($int > 0) {
$chr1 = chr(ord('A') + $int - 1);
}
$chr2 = chr(ord('A') + $frac);
$row++;
return $chr1 . $chr2 . $row;
}
Spreadsheet_Excel_Writer::send (   $filename)

Send HTTP headers for the Excel file.

Parameters
string$filenameThe filename to use for HTTP headers public

Definition at line 65 of file Writer.php.

{
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
}
Spreadsheet_Excel_Writer::send (   $filename)

Send HTTP headers for the Excel file.

Parameters
string$filenameThe filename to use for HTTP headers public

Definition at line 65 of file Writer.php.

{
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
}
Spreadsheet_Excel_Writer::Spreadsheet_Excel_Writer (   $filename = '')

The constructor.

It just creates a Workbook

Parameters
string$filenameThe optional filename for the Workbook.
Returns
Spreadsheet_Excel_Writer_Workbook The Workbook created

Definition at line 53 of file Writer.php.

References $filename, and Spreadsheet_Excel_Writer_Workbook\Spreadsheet_Excel_Writer_Workbook().

{
$this->_filename = $filename;
}

+ Here is the call graph for this function:

Spreadsheet_Excel_Writer::Spreadsheet_Excel_Writer (   $filename = '')

The constructor.

It just creates a Workbook

Parameters
string$filenameThe optional filename for the Workbook.
Returns
Spreadsheet_Excel_Writer_Workbook The Workbook created

Definition at line 53 of file Writer.php.

References $filename, and Spreadsheet_Excel_Writer_Workbook\Spreadsheet_Excel_Writer_Workbook().

{
$this->_filename = $filename;
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: