Skip to content

Commit

Permalink
Added two new functions: set_column() and set_row()
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed May 2, 2006
1 parent 4267f47 commit e6af2ca
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions lib/excellib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,35 @@ function write($row, $col, $token, $format=0) {
}
}

/* Sets the height (and other settings) of one row
* @param integer $row The row to set
* @param integer $height Height we are giving to the row (null to set just format withouth setting the height)
* @param mixed $format The optional XF format we are giving to the row
* @param bool $hidden The optional hidden attribute
* @param integer $level The optional outline level (0-7)
*/
function set_row ($row, $height, $format = 0, $hidden = false, $level = 0) {
/// Calculate the internal PEAR format
$format = $this->MoodleExcelFormat2PearExcelFormat($format);
/// Set the row safely to the PEAR Worksheet
$this->pear_excel_worksheet->setRow($row, $height, $format, $hidden, $level);
}

/* Sets the width (and other settings) of one column
* @param integer $firstcol first column on the range
* @param integer $lastcol last column on the range
* @param integer $width width to set
* @param mixed $format The optional XF format to apply to the columns
* @param integer $hidden The optional hidden atribute
* @param integer $level The optional outline level (0-7)
*/
function set_column ($firstcol, $lastcol, $width, $format = 0, $hidden = false, $level = 0) {
/// Calculate the internal PEAR format
$format = $this->MoodleExcelFormat2PearExcelFormat($format);
/// Set the column safely to the PEAR Worksheet
$this->pear_excel_worksheet->setColumn($firstcol, $lastcol, $width, $format, $hidden, $level);
}

/* Returns the PEAR Excel Format for one Moodle Excel Format
* @param mixed MoodleExcelFormat object
* @return mixed PEAR Excel Format object
Expand Down

0 comments on commit e6af2ca

Please sign in to comment.