ILIAS
release_8 Revision v8.19
|
Public Member Functions | |
__construct () | |
loadFromFile (string $filename) | |
Loads a spreadsheet from file. More... | |
getValidFormats () | |
Get valid file formats. More... | |
setFormat (string $a_format) | |
Set file format. More... | |
addSheet (string $a_name, bool $a_activate=true) | |
Add sheet. More... | |
setActiveSheet (int $a_index) | |
getSheetCount () | |
Returns number of sheets. More... | |
getSheetTitle () | |
Return the current sheet title. More... | |
setCellByCoordinates ($a_coords, $a_value) | |
Set cell value by coordinates. More... | |
setCell (int $a_row, int $a_col, $a_value, ?string $a_datatype=null) | |
Set cell value. More... | |
setCellArray (array $a_values, string $a_top_left="A1", $a_null_value=null) | |
Set cell values from array. More... | |
getCell (int $a_row, int $a_col) | |
Returns the value of a cell. More... | |
getSheetAsArray () | |
Returns the active sheet as an array. More... | |
getColumnCount () | |
Returns the number of columns the sheet contains. More... | |
getColumnCoord (int $a_col) | |
Get column "name" from number. More... | |
sendToClient (string $a_file_name) | |
Send workbook to client. More... | |
writeToFile (string $a_file) | |
Save workbook to file. More... | |
writeToTmpFile () | |
setBold (string $a_coords) | |
Set cell(s) to bold. More... | |
setColors (string $a_coords, string $a_background, string $a_font=null) | |
Set cell(s) colors. More... | |
setBorders (string $a_coords, bool $a_top, bool $a_right=false, bool $a_bottom=false, bool $a_left=false) | |
Toggle cell(s) borders. More... | |
getCoordByColumnAndRow (int $pColumn=1, int $pRow=1) | |
Get cell coordinate (e.g. More... | |
addLink (int $a_row, int $a_column, string $a_path) | |
columnIndexAdjustment (int $column) | |
Adjustment needed because of migration PHPExcel to PhpSpreadsheet. More... | |
mergeCells (string $coordinatesRange) | |
Data Fields | |
const | FORMAT_XML = "Xlsx" |
const | FORMAT_BIFF = "Xls" |
Protected Member Functions | |
prepareValue ($a_value) | |
Prepare value for cell. More... | |
prepareDateValue (ilDateTime $a_value) | |
prepareBooleanValue (bool $a_value) | |
prepareString (string $a_value) | |
setDateFormat (Cell $a_cell, $a_value) | |
Set date format of cell. More... | |
setGlobalAutoSize () | |
Set all existing columns on all sheets to autosize. More... | |
prepareStorage (string $a_file_name) | |
Prepare workbook for storage/delivery. More... | |
Protected Attributes | |
string | $format |
ilLanguage | $lng |
Spreadsheet | $workbook |
string | $type |
Private Member Functions | |
cleanupNonCharachters (string $string) | |
Private Attributes | |
array | $noncharacters |
Definition at line 34 of file class.ilExcel.php.
ilExcel::__construct | ( | ) |
Definition at line 68 of file class.ilExcel.php.
References $DIC, ILIAS\Repository\lng(), and setFormat().
ilExcel::addLink | ( | int | $a_row, |
int | $a_column, | ||
string | $a_path | ||
) |
Definition at line 563 of file class.ilExcel.php.
References columnIndexAdjustment().
ilExcel::addSheet | ( | string | $a_name, |
bool | $a_activate = true |
||
) |
Add sheet.
Definition at line 122 of file class.ilExcel.php.
References setActiveSheet(), and ilStr\shortenTextExtended().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel().
|
private |
Definition at line 590 of file class.ilExcel.php.
Referenced by prepareString().
ilExcel::columnIndexAdjustment | ( | int | $column | ) |
Adjustment needed because of migration PHPExcel to PhpSpreadsheet.
PhpExcel column was 0 index based and PhpSpreadshet set this index to 1
Definition at line 576 of file class.ilExcel.php.
Referenced by addLink(), getCell(), getColumnCoord(), getCoordByColumnAndRow(), and setCell().
ilExcel::getCell | ( | int | $a_row, |
int | $a_col | ||
) |
Returns the value of a cell.
Definition at line 357 of file class.ilExcel.php.
References columnIndexAdjustment().
Referenced by ilDclTextRecordFieldModel\getValueFromExcel(), ilDclBaseRecordFieldModel\getValueFromExcel(), and ilDclStandardField\getValueFromExcel().
ilExcel::getColumnCoord | ( | int | $a_col | ) |
Get column "name" from number.
Definition at line 384 of file class.ilExcel.php.
References columnIndexAdjustment().
Referenced by ilSumScoreTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), assNumeric\setExportDetailsXLS(), assLongMenu\setExportDetailsXLS(), assTextQuestion\setExportDetailsXLS(), assImagemapQuestion\setExportDetailsXLS(), assFileUpload\setExportDetailsXLS(), assOrderingQuestion\setExportDetailsXLS(), assKprimChoice\setExportDetailsXLS(), assSingleChoice\setExportDetailsXLS(), assMultipleChoice\setExportDetailsXLS(), assFormulaQuestion\setExportDetailsXLS(), assClozeTest\setExportDetailsXLS(), and assQuestion\setExportDetailsXLS().
ilExcel::getColumnCount | ( | ) |
Returns the number of columns the sheet contains.
Definition at line 376 of file class.ilExcel.php.
ilExcel::getCoordByColumnAndRow | ( | int | $pColumn = 1 , |
int | $pRow = 1 |
||
) |
Get cell coordinate (e.g.
"B2") for column and row number
Definition at line 550 of file class.ilExcel.php.
References columnIndexAdjustment().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel().
ilExcel::getSheetAsArray | ( | ) |
Returns the active sheet as an array.
Definition at line 368 of file class.ilExcel.php.
ilExcel::getSheetCount | ( | ) |
Returns number of sheets.
Definition at line 159 of file class.ilExcel.php.
ilExcel::getSheetTitle | ( | ) |
Return the current sheet title.
Definition at line 168 of file class.ilExcel.php.
ilExcel::getValidFormats | ( | ) |
Get valid file formats.
Definition at line 97 of file class.ilExcel.php.
Referenced by setFormat().
ilExcel::loadFromFile | ( | string | $filename | ) |
ilExcel::mergeCells | ( | string | $coordinatesRange | ) |
string | $coordinatesRange | A coordinates range string like 'A1:B5' |
Definition at line 585 of file class.ilExcel.php.
|
protected |
Definition at line 223 of file class.ilExcel.php.
References $lng, and ilLanguage\txt().
Referenced by prepareValue().
|
protected |
ilDateTime | $a_value |
Definition at line 208 of file class.ilExcel.php.
References ilDateTime\get(), IL_CAL_DATE, and IL_CAL_DATETIME.
Referenced by prepareValue().
|
protected |
Prepare workbook for storage/delivery.
Definition at line 414 of file class.ilExcel.php.
References setGlobalAutoSize().
Referenced by sendToClient(), and writeToFile().
|
protected |
Definition at line 230 of file class.ilExcel.php.
References cleanupNonCharachters().
Referenced by prepareValue().
|
protected |
Prepare value for cell.
mixed | $a_value |
InvalidArgumentException |
Definition at line 184 of file class.ilExcel.php.
References prepareBooleanValue(), prepareDateValue(), and prepareString().
Referenced by ilAssExcelFormatHelper\setCell(), setCell(), setCellArray(), ilAssExcelFormatHelper\setCellByCoordinates(), and setCellByCoordinates().
ilExcel::sendToClient | ( | string | $a_file_name | ) |
Send workbook to client.
Definition at line 440 of file class.ilExcel.php.
References ilFileDelivery\deliverFileAttached(), ilFileUtils\ilTempnam(), and prepareStorage().
ilExcel::setActiveSheet | ( | int | $a_index | ) |
Definition at line 150 of file class.ilExcel.php.
Referenced by addSheet().
ilExcel::setBold | ( | string | $a_coords | ) |
Set cell(s) to bold.
Definition at line 491 of file class.ilExcel.php.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilSumScoreTableGUI\fillHeaderExcel(), ilLPProgressTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), assNumeric\setExportDetailsXLS(), assLongMenu\setExportDetailsXLS(), assTextQuestion\setExportDetailsXLS(), assImagemapQuestion\setExportDetailsXLS(), assFileUpload\setExportDetailsXLS(), assOrderingQuestion\setExportDetailsXLS(), assKprimChoice\setExportDetailsXLS(), assSingleChoice\setExportDetailsXLS(), assMultipleChoice\setExportDetailsXLS(), assFormulaQuestion\setExportDetailsXLS(), assClozeTest\setExportDetailsXLS(), and ilAssExcelFormatHelper\setFormattedExcelTitle().
ilExcel::setBorders | ( | string | $a_coords, |
bool | $a_top, | ||
bool | $a_right = false , |
||
bool | $a_bottom = false , |
||
bool | $a_left = false |
||
) |
ilExcel::setCell | ( | int | $a_row, |
int | $a_col, | ||
$a_value, | |||
?string | $a_datatype = null |
||
) |
Set cell value.
int | $a_row | |
int | $a_col | |
mixed | $a_value | |
?string | $a_datatype Explicit data type, see DataType::TYPE_* |
Definition at line 288 of file class.ilExcel.php.
References columnIndexAdjustment(), prepareValue(), and setDateFormat().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilDclTextSelectionRecordFieldModel\fillExcelExport(), ilDclTextRecordFieldModel\fillExcelExport(), ilDclBaseRecordFieldModel\fillExcelExport(), ilSumScoreTableGUI\fillHeaderExcel(), ilDclTextFieldModel\fillHeaderExcel(), ilSCORM2004TrackingItemsTableGUI\fillHeaderExcel(), ilSCORMTrackingItemsTableGUI\fillHeaderExcel(), ilDclStandardField\fillHeaderExcel(), ilLPProgressTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilDclBaseFieldModel\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), ilLPTableBaseGUI\fillMetaExcel(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilSumScoreTableGUI\fillRowExcel(), ilPollAnswerTableGUI\fillRowExcel(), ilPollUserTableGUI\fillRowExcel(), ilUserLPTableGUI\fillRowExcel(), ilSCORM2004TrackingItemsTableGUI\fillRowExcel(), ilSCORMTrackingItemsTableGUI\fillRowExcel(), ILIAS\MyStaff\ListCompetences\Skills\ilMStListCompetencesSkillsTableGUI\fillRowExcel(), ILIAS\MyStaff\ListCertificates\ilMStListCertificatesTableGUI\fillRowExcel(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilMStShowUserCoursesTableGUI\fillRowExcel(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRowExcel(), ilLPObjectStatisticsDailyTableGUI\fillRowExcel(), ilMStListCoursesTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPProgressTableGUI\fillRowExcel(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), ilTrMatrixTableGUI\fillRowExcel(), ilBookingReservationsTableGUI\fillRowExcel(), ilTrSummaryTableGUI\fillRowExcel(), ilTable2GUI\fillRowExcel(), and ilSurveyEvaluationGUI\parseResultsToExcel().
ilExcel::setCellArray | ( | array | $a_values, |
string | $a_top_left = "A1" , |
||
$a_null_value = null |
|||
) |
Set cell values from array.
array | $a_values | |
string | $a_top_left | |
mixed | $a_null_value | Value in source array that stands for blank cell |
Definition at line 334 of file class.ilExcel.php.
References $cols, and prepareValue().
ilExcel::setCellByCoordinates | ( | $a_coords, | |
$a_value | |||
) |
Set cell value by coordinates.
string | $a_coords | Coordinate of the cell, eg: 'A1' |
mixed | $a_value |
Definition at line 257 of file class.ilExcel.php.
References prepareValue(), and setDateFormat().
ilExcel::setColors | ( | string | $a_coords, |
string | $a_background, | ||
string | $a_font = null |
||
) |
Set cell(s) colors.
Definition at line 499 of file class.ilExcel.php.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilSurveyEvaluationGUI\parseResultsToExcel(), and ilAssExcelFormatHelper\setFormattedExcelTitle().
|
protected |
Set date format of cell.
Cell | $a_cell | |
mixed | $a_value |
Definition at line 243 of file class.ilExcel.php.
Referenced by setCell(), and setCellByCoordinates().
ilExcel::setFormat | ( | string | $a_format | ) |
Set file format.
Definition at line 105 of file class.ilExcel.php.
References getValidFormats().
Referenced by __construct().
|
protected |
Set all existing columns on all sheets to autosize.
Definition at line 393 of file class.ilExcel.php.
Referenced by prepareStorage().
ilExcel::writeToFile | ( | string | $a_file | ) |
Save workbook to file.
Definition at line 468 of file class.ilExcel.php.
References prepareStorage().
ilExcel::writeToTmpFile | ( | ) |
Definition at line 479 of file class.ilExcel.php.
References $filename, and ilFileUtils\ilTempnam().
|
protected |
Definition at line 38 of file class.ilExcel.php.
|
protected |
Definition at line 61 of file class.ilExcel.php.
Referenced by prepareBooleanValue().
|
private |
Definition at line 40 of file class.ilExcel.php.
|
protected |
Definition at line 63 of file class.ilExcel.php.
|
protected |
Definition at line 62 of file class.ilExcel.php.
const ilExcel::FORMAT_BIFF = "Xls" |
Definition at line 37 of file class.ilExcel.php.
const ilExcel::FORMAT_XML = "Xlsx" |
Definition at line 36 of file class.ilExcel.php.