ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
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=0, $pRow=1) | |
Get cell coordinate (e.g. More... | |
Data Fields | |
const | FORMAT_XML = "Excel2007" |
const | FORMAT_BIFF = "Excel5" |
Protected Member Functions | |
prepareValue ($a_value) | |
Prepare value for cell. More... | |
prepareDateValue (ilDateTime $a_value) | |
prepareBooleanValue ($a_value) | |
prepareString ($a_value) | |
setDateFormat (PHPExcel_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 12 of file class.ilExcel.php.
ilExcel::__construct | ( | ) |
Constructor.
Reimplemented in ilAssExcelFormatHelper.
Definition at line 37 of file class.ilExcel.php.
References $DIC, and setFormat().
ilExcel::addSheet | ( | $a_name, | |
$a_activate = true |
|||
) |
Add sheet.
string | $a_name | |
bool | $a_activate |
Definition at line 98 of file class.ilExcel.php.
References setActiveSheet(), and ilUtil\shortenText().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel().
ilExcel::getCell | ( | $a_row, | |
$a_col | |||
) |
Returns the value of a cell.
int | $a_row | |
int | $a_col |
Definition at line 343 of file class.ilExcel.php.
ilExcel::getColumnCoord | ( | $a_col | ) |
Get column "name" from number.
int | $a_col |
Definition at line 376 of file class.ilExcel.php.
References PHPExcel_Cell\stringFromColumnIndex().
Referenced by ilBookingReservationsTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), and ilTrUserObjectsPropsTableGUI\fillHeaderExcel().
ilExcel::getColumnCount | ( | ) |
Returns the number of columns the sheet contains.
Definition at line 365 of file class.ilExcel.php.
References PHPExcel_Cell\columnIndexFromString().
ilExcel::getCoordByColumnAndRow | ( | $pColumn = 0 , |
|
$pRow = 1 |
|||
) |
Get cell coordinate (e.g.
"B2") for column and row number
int | $pColumn | |
int | $pRow |
Definition at line 558 of file class.ilExcel.php.
References PHPExcel_Cell\stringFromColumnIndex().
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel().
ilExcel::getSheetAsArray | ( | ) |
Returns the active sheet as an array.
Definition at line 354 of file class.ilExcel.php.
ilExcel::getSheetCount | ( | ) |
Returns number of sheets.
Definition at line 137 of file class.ilExcel.php.
ilExcel::getSheetTitle | ( | ) |
Return the current sheet title.
Definition at line 148 of file class.ilExcel.php.
ilExcel::getValidFormats | ( | ) |
Get valid file formats.
Definition at line 69 of file class.ilExcel.php.
Referenced by setFormat().
ilExcel::loadFromFile | ( | $filename | ) |
Loads a spreadsheet from file.
$filename |
Definition at line 55 of file class.ilExcel.php.
References $filename, and PHPExcel_IOFactory\load().
|
protected |
bool | $a_value |
Definition at line 203 of file class.ilExcel.php.
References $lng.
Referenced by prepareValue().
|
protected |
ilDateTime | $a_value |
Definition at line 184 of file class.ilExcel.php.
References ilDateTime\get(), IL_CAL_DATE, IL_CAL_DATETIME, and PHPExcel_Shared_Date\stringToExcel().
Referenced by prepareValue().
|
protected |
Prepare workbook for storage/delivery.
Definition at line 405 of file class.ilExcel.php.
References FORMAT_BIFF, FORMAT_XML, and setGlobalAutoSize().
Referenced by sendToClient(), and writeToFile().
|
protected |
string | $a_value |
Reimplemented in ilAssExcelFormatHelper.
Definition at line 214 of file class.ilExcel.php.
Referenced by prepareValue().
|
protected |
Prepare value for cell.
mixed | $a_value |
Definition at line 164 of file class.ilExcel.php.
References $lng, prepareBooleanValue(), prepareDateValue(), and prepareString().
Referenced by setCell(), ilAssExcelFormatHelper\setCell(), setCellArray(), ilAssExcelFormatHelper\setCellByCoordinates(), and setCellByCoordinates().
ilExcel::sendToClient | ( | $a_file_name | ) |
Send workbook to client.
string | $a_file_name |
Definition at line 432 of file class.ilExcel.php.
References ilMimeTypeUtil\APPLICATION__OCTET_STREAM, ilMimeTypeUtil\APPLICATION__VND_MS_EXCEL, ilMimeTypeUtil\APPLICATION__VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET, PHPExcel_IOFactory\createWriter(), ilFileDelivery\deliverFileAttached(), FORMAT_BIFF, FORMAT_XML, ilUtil\ilTempnam(), and prepareStorage().
ilExcel::setActiveSheet | ( | $a_index | ) |
Set active sheet.
int | $a_index |
Definition at line 126 of file class.ilExcel.php.
Referenced by addSheet().
ilExcel::setBold | ( | $a_coords | ) |
Set cell(s) to bold.
string | $a_coords |
Definition at line 493 of file class.ilExcel.php.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), ilLPProgressTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\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 532 of file class.ilExcel.php.
References $style, and PHPExcel_Style_Border\BORDER_THIN.
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 |
PHPExcel_Exception |
Reimplemented in ilAssExcelFormatHelper.
Definition at line 276 of file class.ilExcel.php.
References prepareValue(), setDateFormat(), PHPExcel_Cell_DataType\TYPE_NUMERIC, and PHPExcel_Cell_DataType\TYPE_STRING.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilBookingReservationsTableGUI\fillHeaderExcel(), ilTable2GUI\fillHeaderExcel(), ilLPProgressTableGUI\fillHeaderExcel(), ilTrMatrixTableGUI\fillHeaderExcel(), ilTrObjectUsersPropsTableGUI\fillHeaderExcel(), ilTrSummaryTableGUI\fillHeaderExcel(), ilTrUserObjectsPropsTableGUI\fillHeaderExcel(), ilDclTextFieldModel\fillHeaderExcel(), ilLPTableBaseGUI\fillMetaExcel(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilBookingReservationsTableGUI\fillRowExcel(), ilPollAnswerTableGUI\fillRowExcel(), ilPollUserTableGUI\fillRowExcel(), ilTable2GUI\fillRowExcel(), ilLPObjectStatisticsDailyTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilLPProgressTableGUI\fillRowExcel(), ilTrMatrixTableGUI\fillRowExcel(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrSummaryTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), ilUserLPTableGUI\fillRowExcel(), ilMStListCoursesTableGUI\fillRowExcel(), ilMStShowUserCoursesTableGUI\fillRowExcel(), ilMStListUsersTableGUI\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 319 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 |
Reimplemented in ilAssExcelFormatHelper.
Definition at line 242 of file class.ilExcel.php.
References prepareValue(), setDateFormat(), PHPExcel_Cell_DataType\TYPE_NUMERIC, and PHPExcel_Cell_DataType\TYPE_STRING.
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 505 of file class.ilExcel.php.
References PHPExcel_Style_Fill\FILL_SOLID.
Referenced by ilSurveyEvaluationGUI\exportResultsDetailsExcel(), ilSurveyEvaluationGUI\parseResultsToExcel(), and ilAssExcelFormatHelper\setFormattedExcelTitle().
|
protected |
Set date format.
PHPExcel_Cell | $a_cell | |
mixed | $a_value |
Definition at line 225 of file class.ilExcel.php.
References PHPExcel_Cell\getStyle().
Referenced by setCell(), and setCellByCoordinates().
ilExcel::setFormat | ( | $a_format | ) |
Set file format.
string | $a_format |
Definition at line 79 of file class.ilExcel.php.
References getValidFormats().
Referenced by __construct().
|
protected |
Set all existing columns on all sheets to autosize.
Definition at line 384 of file class.ilExcel.php.
References $worksheet.
Referenced by prepareStorage().
ilExcel::writeToFile | ( | $a_file | ) |
Save workbook to file.
string | $a_file | full path |
Definition at line 462 of file class.ilExcel.php.
References PHPExcel_IOFactory\createWriter(), and prepareStorage().
ilExcel::writeToTmpFile | ( | ) |
Definition at line 475 of file class.ilExcel.php.
References $filename, PHPExcel_IOFactory\createWriter(), and ilUtil\ilTempnam().
|
protected |
Definition at line 17 of file class.ilExcel.php.
Referenced by prepareBooleanValue(), and prepareValue().
|
protected |
Definition at line 27 of file class.ilExcel.php.
|
protected |
Definition at line 22 of file class.ilExcel.php.
const ilExcel::FORMAT_BIFF = "Excel5" |
Definition at line 30 of file class.ilExcel.php.
Referenced by prepareStorage(), and sendToClient().
const ilExcel::FORMAT_XML = "Excel2007" |
Definition at line 29 of file class.ilExcel.php.
Referenced by prepareStorage(), and sendToClient().