previousSpreadsheet_Excel_Writer::send (Previous) (Next) Format::setAlignnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Spreadsheet_Excel_Writer::rowcolToCell

Spreadsheet_Excel_Writer::rowcolToCell – Utility function for writing formulas.

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

string Spreadsheet_Excel_Writer::rowcolToCell ( integer $row , integer $col )

Description

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

Parameter

  • integer $row - Row for the cell to convert (0-indexed).

  • integer $col - Column for the cell to convert (0-indexed).

Return value

returns The cell identifier in A1 format on success, PEAR_Error on failure

Example

Using rowcolToCell()

<?php
require_once 'Spreadsheet/Excel/Writer.php';

$workbook = new Spreadsheet_Excel_Writer('rowcol.xls');
$worksheet1 =& $workbook->addWorksheet("rowcol");

$first 1;
$last 10;
for (
$i $first$i <= $last$i++) {
    
$worksheet1->write($i1$i);
}
$cell1 Spreadsheet_Excel_Writer::rowcolToCell($first1);
$cell2 Spreadsheet_Excel_Writer::rowcolToCell($last1);
$worksheet1->write($last 10"Total =");
$worksheet1->writeFormula($last 11"=SUM($cell1:$cell2)");
$workbook->close();
?>
previousSpreadsheet_Excel_Writer::send (Previous) (Next) Format::setAlignnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.