ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssExcelFormatHelper Class Reference

Class ilAssExcelFormatHelper. More...

+ Inheritance diagram for ilAssExcelFormatHelper:
+ Collaboration diagram for ilAssExcelFormatHelper:

Public Member Functions

 __construct ()
 ilAssExcelFormatHelper constructor. More...
 
 setFormattedExcelTitle ($coordinates, $value)
 
 setCellByCoordinates ($a_coords, $a_value)
 Set cell value by coordinates.
Parameters
string$a_coords
mixed$a_value
More...
 
 setCell ($a_row, $a_col, $a_value, $datatype=null)
 Set cell value.
Parameters
int$a_row
int$a_col
mixed$a_value
null$a_datatype
Exceptions
PHPExcel_Exception
More...
 
 getStringEscaping ()
 
 setStringEscaping ($stringEscaping)
 
- Public Member Functions inherited from ilExcel
 __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 escapeString = true
 
- Data Fields inherited from ilExcel
const FORMAT_XML = "Excel2007"
 
const FORMAT_BIFF = "Excel5"
 

Protected Member Functions

 prepareString ($a_value)
 
- Protected Member Functions inherited from ilExcel
 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

 $stringEscaping = self::escapeString
 
- Protected Attributes inherited from ilExcel
 $lng
 
 $workbook
 
 $type
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssExcelFormatHelper::__construct ( )

ilAssExcelFormatHelper constructor.

Reimplemented from ilExcel.

Definition at line 19 of file class.ilAssExcelFormatHelper.php.

20 {
21 parent::__construct();
22 }

Member Function Documentation

◆ getStringEscaping()

ilAssExcelFormatHelper::getStringEscaping ( )
Returns
int

Definition at line 86 of file class.ilAssExcelFormatHelper.php.

References $stringEscaping.

◆ prepareString()

ilAssExcelFormatHelper::prepareString (   $a_value)
protected
Parameters
string$a_value
Returns
string

Reimplemented from ilExcel.

Definition at line 74 of file class.ilAssExcelFormatHelper.php.

75 {
76 if ($this->stringEscaping == false) {
77 return $a_value;
78 } else {
79 return strip_tags($a_value);
80 }
81 }

◆ setCell()

ilAssExcelFormatHelper::setCell (   $a_row,
  $a_col,
  $a_value,
  $datatype = null 
)

Set cell value.

Parameters
int$a_row
int$a_col
mixed$a_value
null$a_datatype
Exceptions
PHPExcel_Exception

Reimplemented from ilExcel.

Definition at line 55 of file class.ilAssExcelFormatHelper.php.

56 {
57 if (is_string($a_value) && !is_numeric($a_value)) {
58 $this->workbook->getActiveSheet()->setCellValueExplicitByColumnAndRow(
59 $a_col,
60 $a_row,
61 $this->prepareValue($a_value),
63 true
64 );
65 } else {
66 parent::setCell($a_row, $a_col, $a_value);
67 }
68 }
prepareValue($a_value)
Prepare value for cell.

References ilExcel\prepareValue(), and PHPExcel_Cell_DataType\TYPE_STRING.

+ Here is the call graph for this function:

◆ setCellByCoordinates()

ilAssExcelFormatHelper::setCellByCoordinates (   $a_coords,
  $a_value 
)

Set cell value by coordinates.

Parameters
string$a_coords
mixed$a_value

Reimplemented from ilExcel.

Definition at line 38 of file class.ilAssExcelFormatHelper.php.

39 {
40 if (is_string($a_value) && !is_numeric($a_value)) {
41 $this->workbook->getActiveSheet()->setCellValueExplicit(
42 $a_coords,
43 $this->prepareValue($a_value),
45 true
46 );
47 } else {
48 parent::setCellByCoordinates($a_coords, $a_value);
49 }
50 }

References ilExcel\prepareValue(), and PHPExcel_Cell_DataType\TYPE_STRING.

Referenced by setFormattedExcelTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFormattedExcelTitle()

ilAssExcelFormatHelper::setFormattedExcelTitle (   $coordinates,
  $value 
)
Parameters
string$coordinates
string$value

Definition at line 28 of file class.ilAssExcelFormatHelper.php.

29 {
30 $this->setCellByCoordinates($coordinates, $value);
31 $this->setColors($coordinates, EXCEL_BACKGROUND_COLOR);
32 $this->setBold($coordinates);
33 }
setCellByCoordinates($a_coords, $a_value)
Set cell value by coordinates.
setColors($a_coords, $a_background, $a_font=null)
Set cell(s) colors.
setBold($a_coords)
Set cell(s) to bold.
const EXCEL_BACKGROUND_COLOR

References EXCEL_BACKGROUND_COLOR, ilExcel\setBold(), setCellByCoordinates(), and ilExcel\setColors().

+ Here is the call graph for this function:

◆ setStringEscaping()

ilAssExcelFormatHelper::setStringEscaping (   $stringEscaping)
Parameters
int$stringEscaping

Definition at line 94 of file class.ilAssExcelFormatHelper.php.

95 {
96 $this->stringEscaping = $stringEscaping;
97 }

References $stringEscaping.

Field Documentation

◆ $stringEscaping

ilAssExcelFormatHelper::$stringEscaping = self::escapeString
protected

Definition at line 14 of file class.ilAssExcelFormatHelper.php.

Referenced by getStringEscaping(), and setStringEscaping().

◆ escapeString

const ilAssExcelFormatHelper::escapeString = true

Definition at line 12 of file class.ilAssExcelFormatHelper.php.


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