ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct () | |
Constructor. More... | |
loadFromFile ($filename) | |
Loads a spreadsheet from file. More... | |
getValidFormats () | |
Get valid file formats. More... | |
setFormat ($a_format) | |
Set file format. More... | |
addSheet ($a_name, $a_activate=true) | |
Add sheet. More... | |
setActiveSheet ($a_index) | |
Set active sheet. More... | |
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 ($a_row, $a_col, $a_value, $a_datatype=null) | |
Set cell value. More... | |
setCellArray (array $a_values, $a_top_left="A1", $a_null_value=null) | |
Set cell values from array. More... | |
getCell ($a_row, $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 ($a_col) | |
Get column "name" from number. More... | |
sendToClient ($a_file_name) | |
Send workbook to client. More... | |
writeToFile ($a_file) | |
Save workbook to file. More... | |
writeToTmpFile () | |
setBold ($a_coords) | |
Set cell(s) to bold. More... | |
setColors ($a_coords, $a_background, $a_font=null) | |
Set cell(s) colors. More... | |
setBorders ($a_coords, $a_top, $a_right=false, $a_bottom=false, $a_left=false) | |
Toggle cell(s) borders. More... | |
getCoordByColumnAndRow ($pColumn=1, $pRow=1) | |
Get cell coordinate (e.g. More... | |
addLink ($a_row, $a_column, $a_path) | |
columnIndexAdjustment (int $column) | |
Adjustment needed because of migration PHPExcel to PhpSpreadsheet. More... | |
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 ($a_value) | |
prepareString ($a_value) | |
setDateFormat (Cell $a_cell, $a_value) | |
Set date format. More... | |
setGlobalAutoSize () | |
Set all existing columns on all sheets to autosize. More... | |
prepareStorage ($a_file_name) | |
Prepare workbook for storage/delivery. More... | |
Protected Attributes | |
$lng | |
$workbook | |
$type | |
Definition at line 22 of file class.ilExcel.php.
ilExcel::__construct | ( | ) |
Constructor.
Definition at line 47 of file class.ilExcel.php.
References $DIC, and setFormat().
ilExcel::addLink | ( | $a_row, | |
$a_column, | |||
$a_path | |||
) |
$a_row | int |
$a_column | int |
$a_path |
Definition at line 582 of file class.ilExcel.php.
References columnIndexAdjustment().
ilExcel::addSheet | ( | $a_name, | |
$a_activate = true |
|||
) |
Add sheet.
string | $a_name | |
bool | $a_activate |
Definition at line 108 of file class.ilExcel.php.
References setActiveSheet(), and ilUtil\shortenText().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel().
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
$column |
Definition at line 595 of file class.ilExcel.php.
Referenced by addLink(), getCell(), getColumnCoord(), getCoordByColumnAndRow(), and setCell().
ilExcel::getCell | ( | $a_row, | |
$a_col | |||
) |
Returns the value of a cell.
int | $a_row | |
int | $a_col |
Definition at line 350 of file class.ilExcel.php.
References columnIndexAdjustment().
ilExcel::getColumnCoord | ( | $a_col | ) |
Get column "name" from number.
int | $a_col |
Definition at line 385 of file class.ilExcel.php.
References columnIndexAdjustment().
Referenced by ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), and ilTable2GUI\fillHeaderExcel().
ilExcel::getColumnCount | ( | ) |
Returns the number of columns the sheet contains.
Definition at line 374 of file class.ilExcel.php.
ilExcel::getCoordByColumnAndRow | ( | $pColumn = 1 , |
|
$pRow = 1 |
|||
) |
Get cell coordinate (e.g.
"B2") for column and row number
int | $pColumn | |
int | $pRow |
Definition at line 569 of file class.ilExcel.php.
References columnIndexAdjustment().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel().
ilExcel::getSheetAsArray | ( | ) |
Returns the active sheet as an array.
Definition at line 363 of file class.ilExcel.php.
ilExcel::getSheetCount | ( | ) |
ilExcel::getSheetTitle | ( | ) |
ilExcel::getValidFormats | ( | ) |
Get valid file formats.
Definition at line 79 of file class.ilExcel.php.
Referenced by setFormat().
ilExcel::loadFromFile | ( | $filename | ) |
Loads a spreadsheet from file.
$filename |
Definition at line 65 of file class.ilExcel.php.
References $filename.
|
protected |
bool | $a_value |
Definition at line 213 of file class.ilExcel.php.
References $lng.
Referenced by prepareValue().
|
protected |
ilDateTime | $a_value |
Definition at line 194 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 416 of file class.ilExcel.php.
References setGlobalAutoSize().
Referenced by sendToClient(), and writeToFile().
|
protected |
string | $a_value |
Definition at line 224 of file class.ilExcel.php.
Referenced by prepareValue().
|
protected |
Prepare value for cell.
mixed | $a_value |
Definition at line 174 of file class.ilExcel.php.
References $lng, prepareBooleanValue(), prepareDateValue(), and prepareString().
Referenced by ilAssExcelFormatHelper\setCell(), setCell(), setCellArray(), ilAssExcelFormatHelper\setCellByCoordinates(), and setCellByCoordinates().
ilExcel::sendToClient | ( | $a_file_name | ) |
Send workbook to client.
string | $a_file_name |
Definition at line 443 of file class.ilExcel.php.
References ilMimeTypeUtil\APPLICATION__OCTET_STREAM, ilMimeTypeUtil\APPLICATION__VND_MS_EXCEL, ilMimeTypeUtil\APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET, ilFileDelivery\deliverFileAttached(), ilUtil\ilTempnam(), and prepareStorage().
ilExcel::setActiveSheet | ( | $a_index | ) |
Set active sheet.
int | $a_index |
Definition at line 136 of file class.ilExcel.php.
Referenced by addSheet().
ilExcel::setBold | ( | $a_coords | ) |
Set cell(s) to bold.
string | $a_coords |
Definition at line 504 of file class.ilExcel.php.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilLPProgressTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), and ilAssExcelFormatHelper\setFormattedExcelTitle().
ilExcel::setBorders | ( | $a_coords, | |
$a_top, | |||
$a_right = false , |
|||
$a_bottom = false , |
|||
$a_left = false |
|||
) |
Toggle cell(s) borders.
string | $a_coords | |
bool | $a_top | |
bool | $a_right | |
bool | $a_bottom | |
bool | $a_left |
Definition at line 543 of file class.ilExcel.php.
References $style.
ilExcel::setCell | ( | $a_row, | |
$a_col, | |||
$a_value, | |||
$a_datatype = null |
|||
) |
Set cell value.
int | $a_row | |
int | $a_col | |
mixed | $a_value | |
null | $a_datatype |
Definition at line 284 of file class.ilExcel.php.
References columnIndexAdjustment(), prepareValue(), and setDateFormat().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilDclTextSelectionRecordFieldModel\fillExcelExport(), ilDclTextRecordFieldModel\fillExcelExport(), ilDclBaseRecordFieldModel\fillExcelExport(), ilDclTextFieldModel\fillHeaderExcel(), ilSCORMTrackingItemsTableGUI\fillHeaderExcel(), ilSCORM2004TrackingItemsTableGUI\fillHeaderExcel(), ilLPProgressTableGUI\fillHeaderExcel(), ilDclStandardField\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilDclBaseFieldModel\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), ilLPTableBaseGUI\fillMetaExcel(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilPollAnswerTableGUI\fillRowExcel(), ilPollUserTableGUI\fillRowExcel(), ilUserLPTableGUI\fillRowExcel(), ilSCORMTrackingItemsTableGUI\fillRowExcel(), ilSCORM2004TrackingItemsTableGUI\fillRowExcel(), ilMStShowUserCoursesTableGUI\fillRowExcel(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilLPObjectStatisticsDailyTableGUI\fillRowExcel(), ilMStListUsersTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPProgressTableGUI\fillRowExcel(), ilMStListCoursesTableGUI\fillRowExcel(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), ilTrMatrixTableGUI\fillRowExcel(), ilTrSummaryTableGUI\fillRowExcel(), ilBookingReservationsTableGUI\fillRowExcel(), ilTable2GUI\fillRowExcel(), and ilSurveyEvaluationGUI\parseResultsToExcel().
ilExcel::setCellArray | ( | array | $a_values, |
$a_top_left = "A1" , |
|||
$a_null_value = null |
|||
) |
Set cell values from array.
array | $a_values | |
string | $a_top_left | |
mixed | $a_null_value |
Definition at line 326 of file class.ilExcel.php.
References $cols, and prepareValue().
ilExcel::setCellByCoordinates | ( | $a_coords, | |
$a_value | |||
) |
Set cell value by coordinates.
string | $a_coords | |
mixed | $a_value |
Definition at line 252 of file class.ilExcel.php.
References prepareValue(), and setDateFormat().
ilExcel::setColors | ( | $a_coords, | |
$a_background, | |||
$a_font = null |
|||
) |
Set cell(s) colors.
string | $a_coords | |
string | $a_background | |
string | $a_font |
Definition at line 516 of file class.ilExcel.php.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilSurveyEvaluationGUI\parseResultsToExcel(), and ilAssExcelFormatHelper\setFormattedExcelTitle().
|
protected |
Set date format.
Cell | $a_cell | |
mixed | $a_value |
Definition at line 235 of file class.ilExcel.php.
References PhpOffice\PhpSpreadsheet\Cell\Cell\getStyle().
Referenced by setCell(), and setCellByCoordinates().
ilExcel::setFormat | ( | $a_format | ) |
Set file format.
string | $a_format |
Definition at line 89 of file class.ilExcel.php.
References getValidFormats().
Referenced by __construct().
|
protected |
Set all existing columns on all sheets to autosize.
Definition at line 395 of file class.ilExcel.php.
Referenced by prepareStorage().
ilExcel::writeToFile | ( | $a_file | ) |
Save workbook to file.
string | $a_file | full path |
Definition at line 473 of file class.ilExcel.php.
References prepareStorage().
ilExcel::writeToTmpFile | ( | ) |
Definition at line 486 of file class.ilExcel.php.
References $filename, and ilUtil\ilTempnam().
|
protected |
Definition at line 27 of file class.ilExcel.php.
Referenced by prepareBooleanValue(), and prepareValue().
|
protected |
Definition at line 37 of file class.ilExcel.php.
|
protected |
Definition at line 32 of file class.ilExcel.php.
const ilExcel::FORMAT_BIFF = "Xls" |
Definition at line 40 of file class.ilExcel.php.
const ilExcel::FORMAT_XML = "Xlsx" |
Definition at line 39 of file class.ilExcel.php.