Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
OpenSpout\Writer\Common\Entity\Sheet Class Reference

Public Member Functions

 __construct (int $sheetIndex, string $associatedWorkbookId, SheetManager $sheetManager)
 
 getAssociatedWorkbookId ()
 
 getAutoFilter ()
 
 getColumnWidths ()
 
 getIndex ()
 
 getName ()
 
 getSheetView ()
 
 getWrittenRowCount ()
 
 incrementWrittenRowCount ()
 
 isVisible ()
 
 setAutoFilter (?AutoFilter $autoFilter)
 
 setColumnWidth (float $width, int ... $columns)
 
 setColumnWidthForRange (float $width, int $start, int $end)
 
 setIsVisible (bool $isVisible)
 
 setName (string $name)
 Sets the name of the sheet.
 
 setSheetView (SheetView $sheetView)
 

Public Attributes

const DEFAULT_SHEET_NAME_PREFIX = 'Sheet'
 

Constructor & Destructor Documentation

◆ __construct()

OpenSpout\Writer\Common\Entity\Sheet::__construct ( int $sheetIndex,
string $associatedWorkbookId,
SheetManager $sheetManager )
Parameters
0 | positive-int$sheetIndexIndex of the sheet, based on order in the workbook (zero-based)
string$associatedWorkbookIdID of the sheet's associated workbook
SheetManager$sheetManagerTo manage sheets

Member Function Documentation

◆ getIndex()

OpenSpout\Writer\Common\Entity\Sheet::getIndex ( )
Return values
0|positive-intIndex of the sheet, based on order in the workbook (zero-based)

◆ getName()

OpenSpout\Writer\Common\Entity\Sheet::getName ( )
Return values
stringName of the sheet

◆ getWrittenRowCount()

OpenSpout\Writer\Common\Entity\Sheet::getWrittenRowCount ( )
Return values
0|positive-int

◆ isVisible()

OpenSpout\Writer\Common\Entity\Sheet::isVisible ( )
Return values
boolisVisible Visibility of the sheet

◆ setAutoFilter()

OpenSpout\Writer\Common\Entity\Sheet::setAutoFilter ( ?AutoFilter $autoFilter)
Return values
$this

◆ setColumnWidth()

OpenSpout\Writer\Common\Entity\Sheet::setColumnWidth ( float $width,
int ... $columns )
Parameters
positive-int...$columns One or more columns with this width

◆ setColumnWidthForRange()

OpenSpout\Writer\Common\Entity\Sheet::setColumnWidthForRange ( float $width,
int $start,
int $end )
Parameters
float$widthThe width to set
positive-int$startFirst column index of the range
positive-int$endLast column index of the range

◆ setIsVisible()

OpenSpout\Writer\Common\Entity\Sheet::setIsVisible ( bool $isVisible)
Parameters
bool$isVisibleVisibility of the sheet

◆ setName()

OpenSpout\Writer\Common\Entity\Sheet::setName ( string $name)

Sets the name of the sheet.

Note that Excel has some restrictions on the name:

  • it should not be blank
  • it should not exceed 31 characters
  • it should not contain these characters: / ? * : [ or ]
  • it should be unique.
Parameters
string$nameName of the sheet
Exceptions
OpenSpout\Writer\Exception\InvalidSheetNameExceptionif the sheet's name is invalid

◆ setSheetView()

OpenSpout\Writer\Common\Entity\Sheet::setSheetView ( SheetView $sheetView)
Return values
$this

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