Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-14249, add more needed functions to excellib.php

  • Loading branch information...
commit 58ab8bffd3b7ffb1ee1ff44a41eccc2e3ca6d806 1 parent 7cad8ab
dongsheng authored
Showing with 51 additions and 0 deletions.
  1. +51 −0 lib/excellib.class.php
View
51 lib/excellib.class.php
@@ -258,6 +258,57 @@ function set_column ($firstcol, $lastcol, $width, $format = null, $hidden = fals
$this->pear_excel_worksheet->setColumn($firstcol, $lastcol, $width, $format, $hidden, $level);
}
+ /**
+ * Set the option to hide gridlines on the printed page.
+ *
+ * @access public
+ */
+ function hide_gridlines() {
+ $this->pear_excel_worksheet->hideGridLines();
+ }
+
+ /**
+ * Set the option to hide gridlines on the worksheet (as seen on the screen).
+ *
+ * @access public
+ */
+ function hide_screen_gridlines() {
+ $this->pear_excel_worksheet->hideScreenGridlines();
+ }
+
+ /**
+ * Insert a 24bit bitmap image in a worksheet.
+ *
+ * @access public
+ * @param integer $row The row we are going to insert the bitmap into
+ * @param integer $col The column we are going to insert the bitmap into
+ * @param string $bitmap The bitmap filename
+ * @param integer $x The horizontal position (offset) of the image inside the cell.
+ * @param integer $y The vertical position (offset) of the image inside the cell.
+ * @param integer $scale_x The horizontal scale
+ * @param integer $scale_y The vertical scale
+ */
+ function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) {
+ /// Add the bitmap safely to the PEAR Worksheet
+ $this->pear_excel_worksheet->insertBitmap($row, $col, $bitmap, $x, $y, $scale_x, $scale_y);
+ }
+
+ /**
+ * Merges the area given by its arguments.
+ * This is an Excel97/2000 method. It is required to perform more complicated
+ * merging than the normal setAlign('merge').
+ *
+ * @access public
+ * @param integer $first_row First row of the area to merge
+ * @param integer $first_col First column of the area to merge
+ * @param integer $last_row Last row of the area to merge
+ * @param integer $last_col Last column of the area to merge
+ */
+ function merge_cells($first_row, $first_col, $last_row, $last_col) {
+ /// Merge cells safely to the PEAR Worksheet
+ $this->pear_excel_worksheet->mergeCells($first_row, $first_col, $last_row, $last_col);
+ }
+
/* Returns the PEAR Excel Format for one Moodle Excel Format
* @param mixed MoodleExcelFormat object
* @return mixed PEAR Excel Format object
Please sign in to comment.
Something went wrong with that request. Please try again.