Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
MoodleODSWorksheet Class Reference

ODS Worksheet abstraction. More...

Public Member Functions

 __construct ($name, array $worksheets)
 Constructs one Moodle Worksheet.
 
 hide_gridlines ()
 Set the option to hide gridlines on the printed page.
 
 hide_screen_gridlines ()
 Set the option to hide gridlines on the worksheet (as seen on the screen).
 
 insert_bitmap ($row, $col, $bitmap, $x=0, $y=0, $scale_x=1, $scale_y=1)
 Insert a 24bit bitmap image in a worksheet.
 
 merge_cells ($first_row, $first_col, $last_row, $last_col)
 Merges the area given by its arguments.
 
 set_column ($firstcol, $lastcol, $width, $format=null, $hidden=false, $level=0)
 Sets the width (and other settings) of one column.
 
 set_row ($row, $height, $format=null, $hidden=false, $level=0)
 Sets the height (and other settings) of one row.
 
 write ($row, $col, $token, $format=null)
 Write anything somewhere in the worksheet, type will be automatically detected.
 
 write_blank ($row, $col, $format=null)
 Write one blank somewhere in the worksheet.
 
 write_date ($row, $col, $date, $format=null)
 Write one date somewhere in the worksheet.
 
 write_formula ($row, $col, $formula, $format=null)
 Write one formula somewhere in the worksheet.
 
 write_number ($row, $col, $num, $format=null)
 Write one number somewhere in the worksheet.
 
 write_string ($row, $col, $str, $format=null)
 Write one string somewhere in the worksheet.
 
 write_url ($row, $col, $url, $format=null)
 Write one url somewhere in the worksheet.
 

Public Attributes

 $columns = array()
 
 $data = array()
 
int $maxc = 0
 Max number of cols in the sheet.
 
int $maxr = 0
 Max number of rows in the sheet.
 
 $name
 
 $rows = array()
 
 $showgrid = true
 

Detailed Description

ODS Worksheet abstraction.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

MoodleODSWorksheet::__construct ( $name,
array $worksheets )

Constructs one Moodle Worksheet.

Parameters
string$nameThe name of the file
array$worksheetsexisting worksheets

Member Function Documentation

◆ insert_bitmap()

MoodleODSWorksheet::insert_bitmap ( $row,
$col,
$bitmap,
$x = 0,
$y = 0,
$scale_x = 1,
$scale_y = 1 )

Insert a 24bit bitmap image in a worksheet.

Parameters
integer$rowThe row we are going to insert the bitmap into
integer$colThe column we are going to insert the bitmap into
string$bitmapThe bitmap filename
integer$xThe horizontal position (offset) of the image inside the cell.
integer$yThe vertical position (offset) of the image inside the cell.
integer$scale_xThe horizontal scale
integer$scale_yThe vertical scale

◆ merge_cells()

MoodleODSWorksheet::merge_cells ( $first_row,
$first_col,
$last_row,
$last_col )

Merges the area given by its arguments.

Parameters
integer$first_rowFirst row of the area to merge
integer$first_colFirst column of the area to merge
integer$last_rowLast row of the area to merge
integer$last_colLast column of the area to merge

◆ set_column()

MoodleODSWorksheet::set_column ( $firstcol,
$lastcol,
$width,
$format = null,
$hidden = false,
$level = 0 )

Sets the width (and other settings) of one column.

Parameters
integer$firstcolfirst column on the range
integer$lastcollast column on the range
integer$widthwidth to set (null to set just format without setting the width)
mixed$formatThe optional format to apply to the columns
bool$hiddenThe optional hidden attribute
integer$levelThe optional outline level (0-7)

◆ set_row()

MoodleODSWorksheet::set_row ( $row,
$height,
$format = null,
$hidden = false,
$level = 0 )

Sets the height (and other settings) of one row.

Parameters
integer$rowThe row to set
integer$heightHeight we are giving to the row (null to set just format without setting the height)
mixed$formatThe optional format we are giving to the row
bool$hiddenThe optional hidden attribute
integer$levelThe optional outline level (0-7)

◆ write()

MoodleODSWorksheet::write ( $row,
$col,
$token,
$format = null )

Write anything somewhere in the worksheet, type will be automatically detected.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
mixed$tokenWhat we are writing
mixed$formatThe XF format for the cell

◆ write_blank()

MoodleODSWorksheet::write_blank ( $row,
$col,
$format = null )

Write one blank somewhere in the worksheet.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
mixed$formatThe XF format for the cell

◆ write_date()

MoodleODSWorksheet::write_date ( $row,
$col,
$date,
$format = null )

Write one date somewhere in the worksheet.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
string$dateThe url to write
mixed$formatThe XF format for the cell

◆ write_formula()

MoodleODSWorksheet::write_formula ( $row,
$col,
$formula,
$format = null )

Write one formula somewhere in the worksheet.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
string$formulaThe formula to write
mixed$formatThe XF format for the cell

◆ write_number()

MoodleODSWorksheet::write_number ( $row,
$col,
$num,
$format = null )

Write one number somewhere in the worksheet.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
float$numThe number to write
mixed$formatThe XF format for the cell

◆ write_string()

MoodleODSWorksheet::write_string ( $row,
$col,
$str,
$format = null )

Write one string somewhere in the worksheet.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
string$strThe string to write
mixed$formatThe XF format for the cell

◆ write_url()

MoodleODSWorksheet::write_url ( $row,
$col,
$url,
$format = null )

Write one url somewhere in the worksheet.

Parameters
integer$rowZero indexed row
integer$colZero indexed column
string$urlThe url to write
mixed$formatThe XF format for the cell

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