MDL-65741 libraries: Fix coding style errors in Excel lib
This commit is contained in:
+45
-44
@@ -110,7 +110,7 @@ class MoodleExcelWorkbook {
|
||||
public function close() {
|
||||
global $CFG;
|
||||
|
||||
foreach ($this->objspreadsheet->getAllSheets() as $sheet){
|
||||
foreach ($this->objspreadsheet->getAllSheets() as $sheet) {
|
||||
$sheet->setSelectedCells('A1');
|
||||
}
|
||||
$this->objspreadsheet->setActiveSheetIndex(0);
|
||||
@@ -139,8 +139,8 @@ class MoodleExcelWorkbook {
|
||||
header('Content-Type: '.$mimetype);
|
||||
header('Content-Disposition: attachment;filename="'.$filename.'"');
|
||||
|
||||
$objWriter = IOFactory::createWriter($this->objspreadsheet, $this->type);
|
||||
$objWriter->save('php://output');
|
||||
$objwriter = IOFactory::createWriter($this->objspreadsheet, $this->type);
|
||||
$objwriter->save('php://output');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,8 +203,8 @@ class MoodleExcelWorksheet {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$col += 1;
|
||||
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
|
||||
$this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $str, DataType::TYPE_STRING);
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row + 1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
|
||||
$this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $str, DataType::TYPE_STRING);
|
||||
$this->apply_format($row, $col, $format);
|
||||
}
|
||||
|
||||
@@ -220,8 +220,8 @@ class MoodleExcelWorksheet {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$col += 1;
|
||||
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_GENERAL);
|
||||
$this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $num, DataType::TYPE_NUMERIC);
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row + 1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_GENERAL);
|
||||
$this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $num, DataType::TYPE_NUMERIC);
|
||||
$this->apply_format($row, $col, $format);
|
||||
}
|
||||
|
||||
@@ -237,8 +237,8 @@ class MoodleExcelWorksheet {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$col += 1;
|
||||
|
||||
$this->worksheet->setCellValueByColumnAndRow($col, $row+1, $url);
|
||||
$this->worksheet->getCellByColumnAndRow($col, $row+1)->getHyperlink()->setUrl($url);
|
||||
$this->worksheet->setCellValueByColumnAndRow($col, $row + 1, $url);
|
||||
$this->worksheet->getCellByColumnAndRow($col, $row + 1)->getHyperlink()->setUrl($url);
|
||||
$this->apply_format($row, $col, $format);
|
||||
}
|
||||
|
||||
@@ -263,8 +263,9 @@ class MoodleExcelWorksheet {
|
||||
$getdate['seconds']
|
||||
);
|
||||
|
||||
$this->worksheet->setCellValueByColumnAndRow($col, $row+1, $exceldate);
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_XLSX22);
|
||||
$this->worksheet->setCellValueByColumnAndRow($col, $row + 1, $exceldate);
|
||||
$style = $this->worksheet->getStyleByColumnAndRow($col, $row + 1);
|
||||
$style->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_XLSX22);
|
||||
$this->apply_format($row, $col, $format);
|
||||
}
|
||||
|
||||
@@ -280,7 +281,7 @@ class MoodleExcelWorksheet {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$col += 1;
|
||||
|
||||
$this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $formula, DataType::TYPE_FORMULA);
|
||||
$this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $formula, DataType::TYPE_FORMULA);
|
||||
$this->apply_format($row, $col, $format);
|
||||
}
|
||||
|
||||
@@ -295,7 +296,7 @@ class MoodleExcelWorksheet {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$col += 1;
|
||||
|
||||
$this->worksheet->setCellValueByColumnAndRow($col, $row+1, '');
|
||||
$this->worksheet->setCellValueByColumnAndRow($col, $row + 1, '');
|
||||
$this->apply_format($row, $col, $format);
|
||||
}
|
||||
|
||||
@@ -353,10 +354,10 @@ class MoodleExcelWorksheet {
|
||||
$level = 7;
|
||||
}
|
||||
if (isset($height)) {
|
||||
$this->worksheet->getRowDimension($row+1)->setRowHeight($height);
|
||||
$this->worksheet->getRowDimension($row + 1)->setRowHeight($height);
|
||||
}
|
||||
$this->worksheet->getRowDimension($row+1)->setVisible(!$hidden);
|
||||
$this->worksheet->getRowDimension($row+1)->setOutlineLevel($level);
|
||||
$this->worksheet->getRowDimension($row + 1)->setVisible(!$hidden);
|
||||
$this->worksheet->getRowDimension($row + 1)->setOutlineLevel($level);
|
||||
$this->apply_row_format($row, $format);
|
||||
}
|
||||
|
||||
@@ -378,7 +379,7 @@ class MoodleExcelWorksheet {
|
||||
}
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$i = $firstcol + 1;
|
||||
while($i <= $lastcol + 1) {
|
||||
while ($i <= $lastcol + 1) {
|
||||
if (isset($width)) {
|
||||
$this->worksheet->getColumnDimensionByColumn($i)->setWidth($width);
|
||||
}
|
||||
@@ -411,40 +412,40 @@ class MoodleExcelWorksheet {
|
||||
* @param string $bitmap The bitmap filename
|
||||
* @param integer $x The horizontal position (offset) of the image inside the cell.
|
||||
* @param integer $y The vertical position (offset) of the image inside the cell.
|
||||
* @param integer $scale_x The horizontal scale
|
||||
* @param integer $scale_y The vertical scale
|
||||
* @param integer $scalex The horizontal scale
|
||||
* @param integer $scaley The vertical scale
|
||||
*/
|
||||
public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) {
|
||||
public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scalex = 1, $scaley = 1) {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$col += 1;
|
||||
|
||||
$objDrawing = new Drawing();
|
||||
$objDrawing->setPath($bitmap);
|
||||
$objDrawing->setCoordinates(Coordinate::stringFromColumnIndex($col) . ($row+1));
|
||||
$objDrawing->setOffsetX($x);
|
||||
$objDrawing->setOffsetY($y);
|
||||
$objDrawing->setWorksheet($this->worksheet);
|
||||
$objdrawing = new Drawing();
|
||||
$objdrawing->setPath($bitmap);
|
||||
$objdrawing->setCoordinates(Coordinate::stringFromColumnIndex($col) . ($row + 1));
|
||||
$objdrawing->setOffsetX($x);
|
||||
$objdrawing->setOffsetY($y);
|
||||
$objdrawing->setWorksheet($this->worksheet);
|
||||
if ($scale_x != 1) {
|
||||
$objDrawing->setResizeProportional(false);
|
||||
$objDrawing->getWidth($objDrawing->getWidth()*$scale_x);
|
||||
$objdrawing->setResizeProportional(false);
|
||||
$objdrawing->getWidth($objdrawing->getWidth() * $scalex);
|
||||
}
|
||||
if ($scale_y != 1) {
|
||||
$objDrawing->setResizeProportional(false);
|
||||
$objDrawing->setHeight($objDrawing->getHeight()*$scale_y);
|
||||
$objdrawing->setResizeProportional(false);
|
||||
$objdrawing->setHeight($objdrawing->getHeight() * $scaley);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges the area given by its arguments.
|
||||
*
|
||||
* @param integer $first_row First row of the area to merge
|
||||
* @param integer $first_col First column of the area to merge
|
||||
* @param integer $last_row Last row of the area to merge
|
||||
* @param integer $last_col Last column of the area to merge
|
||||
* @param integer $firstrow First row of the area to merge
|
||||
* @param integer $firstcol First column of the area to merge
|
||||
* @param integer $lastrow Last row of the area to merge
|
||||
* @param integer $lastcol Last column of the area to merge
|
||||
*/
|
||||
public function merge_cells($first_row, $first_col, $last_row, $last_col) {
|
||||
public function merge_cells($firstrow, $firstcol, $lastrow, $lastcol) {
|
||||
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
|
||||
$this->worksheet->mergeCellsByColumnAndRow($first_col + 1, $first_row+1, $last_col + 1, $last_row+1);
|
||||
$this->worksheet->mergeCellsByColumnAndRow($firstcol + 1, $firstrow + 1, $lastcol + 1, $lastrow + 1);
|
||||
}
|
||||
|
||||
protected function apply_format($row, $col, $format = null) {
|
||||
@@ -453,7 +454,7 @@ class MoodleExcelWorksheet {
|
||||
} else if (is_array($format)) {
|
||||
$format = new MoodleExcelFormat($format);
|
||||
}
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row+1)->applyFromArray($format->get_format_array());
|
||||
$this->worksheet->getStyleByColumnAndRow($col, $row + 1)->applyFromArray($format->get_format_array());
|
||||
}
|
||||
|
||||
protected function apply_column_format($col, $format = null) {
|
||||
@@ -471,7 +472,7 @@ class MoodleExcelWorksheet {
|
||||
} else if (is_array($format)) {
|
||||
$format = new MoodleExcelFormat($format);
|
||||
}
|
||||
$this->worksheet->getStyle($row+1)->applyFromArray($format->get_format_array());
|
||||
$this->worksheet->getStyle($row + 1)->applyFromArray($format->get_format_array());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,9 +864,9 @@ class MoodleExcelFormat {
|
||||
* Set the numerical format of the format.
|
||||
* It can be date, time, currency, etc...
|
||||
*
|
||||
* @param mixed $num_format The numeric format
|
||||
* @param mixed $numformat The numeric format
|
||||
*/
|
||||
public function set_num_format($num_format) {
|
||||
public function set_num_format($numformat) {
|
||||
$numbers = array();
|
||||
|
||||
$numbers[1] = '0';
|
||||
@@ -882,14 +883,14 @@ class MoodleExcelFormat {
|
||||
$numbers[22] = 'm/d/yy h:mm';
|
||||
$numbers[49] = '@';
|
||||
|
||||
if ($num_format !== 0 and in_array($num_format, $numbers)) {
|
||||
$this->format['numberFormat']['formatCode'] = $num_format;
|
||||
if ($numformat !== 0 and in_array($numformat, $numbers)) {
|
||||
$this->format['numberFormat']['formatCode'] = $numformat;
|
||||
}
|
||||
|
||||
if (!isset($numbers[$num_format])) {
|
||||
if (!isset($numbers[$numformat])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->format['numberFormat']['formatCode'] = $numbers[$num_format];
|
||||
$this->format['numberFormat']['formatCode'] = $numbers[$numformat];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ $worksheet = $workbook->add_worksheet('Supported');
|
||||
$worksheet->hide_screen_gridlines();
|
||||
|
||||
$worksheet->write_string(0, 0, 'Moodle worksheet export test',
|
||||
$workbook->add_format(array('color'=>'red', 'size'=>20, 'bold'=>1, 'italic'=>1)));
|
||||
$workbook->add_format(array('color' => 'red', 'size' => 20, 'bold' => 1, 'italic' => 1)));
|
||||
$worksheet->set_row(0, 25);
|
||||
$worksheet->write(1, 0, 'Moodle release: '.$CFG->release, $workbook->add_format(array('size'=>8, 'italic'=>1)));
|
||||
$worksheet->write(1, 0, 'Moodle release: '.$CFG->release, $workbook->add_format(array('size' => 8, 'italic' => 1)));
|
||||
|
||||
$worksheet->set_column(0, 0, 20);
|
||||
$worksheet->set_column(1, 1, 30);
|
||||
@@ -94,7 +94,7 @@ $worksheet->set_column(2, 2, 5);
|
||||
$worksheet->set_column(3, 3, 30);
|
||||
$worksheet->set_column(4, 4, 20);
|
||||
|
||||
$miniheading = $workbook->add_format(array('size'=>15, 'bold'=>1, 'italic'=>1, 'underline'=>1));
|
||||
$miniheading = $workbook->add_format(array('size' => 15, 'bold' => 1, 'italic' => 1, 'underline' => 1));
|
||||
|
||||
|
||||
$worksheet->write(2, 0, 'Cell types', $miniheading);
|
||||
@@ -123,7 +123,7 @@ $worksheet->write(10, 0, 'Formula');
|
||||
$worksheet->write(10, 1, '=1+2');
|
||||
|
||||
$worksheet->write(11, 0, 'Blank');
|
||||
$worksheet->write_blank(11, 1, $workbook->add_format(array('bg_color'=>'silver')));
|
||||
$worksheet->write_blank(11, 1, $workbook->add_format(array('bg_color' => 'silver')));
|
||||
|
||||
|
||||
$worksheet->write(14, 0, 'Text formats', $miniheading);
|
||||
@@ -131,92 +131,93 @@ $worksheet->set_row(14, 20);
|
||||
$worksheet->set_row(15, 5);
|
||||
|
||||
// Following writes use alternative format array.
|
||||
$worksheet->write(16, 0, 'Bold', array('bold'=>1));
|
||||
$worksheet->write(17, 0, 'Italic', array('italic'=>1));
|
||||
$worksheet->write(18, 0, 'Single underline', array('underline'=>1));
|
||||
$worksheet->write(19, 0, 'Double underline', array('underline'=>2));
|
||||
$worksheet->write(20, 0, 'Strikeout', array('strikeout'=>1));
|
||||
$worksheet->write(21, 0, 'Superscript', array('script'=>1));
|
||||
$worksheet->write(22, 0, 'Subscript', array('script'=>2));
|
||||
$worksheet->write(23, 0, 'Red', array('color'=>'red'));
|
||||
$worksheet->write(16, 0, 'Bold', array('bold' => 1));
|
||||
$worksheet->write(17, 0, 'Italic', array('italic' => 1));
|
||||
$worksheet->write(18, 0, 'Single underline', array('underline' => 1));
|
||||
$worksheet->write(19, 0, 'Double underline', array('underline' => 2));
|
||||
$worksheet->write(20, 0, 'Strikeout', array('strikeout' => 1));
|
||||
$worksheet->write(21, 0, 'Superscript', array('script' => 1));
|
||||
$worksheet->write(22, 0, 'Subscript', array('script' => 2));
|
||||
$worksheet->write(23, 0, 'Red', array('color' => 'red'));
|
||||
|
||||
|
||||
$worksheet->write(25, 0, 'Text align', $miniheading);
|
||||
$worksheet->set_row(25, 20);
|
||||
$worksheet->set_row(26, 5);
|
||||
|
||||
$worksheet->write(27, 0, 'Wrapped text - Žloťoučký koníček', $workbook->add_format(array('text_wrap'=>true, 'border'=>1)));
|
||||
$worksheet->write(27, 0, 'Wrapped text - Žloťoučký koníček',
|
||||
$workbook->add_format(array('text_wrap' => true, 'border' => 1)));
|
||||
$worksheet->set_row(27, 30);
|
||||
$worksheet->write(27, 1, 'All centered',
|
||||
$workbook->add_format(array('v_align'=>'center', 'h_align'=>'center', 'border'=>1)));
|
||||
$worksheet->write(28, 0, 'Top', $workbook->add_format(array('align'=>'top', 'border'=>1)));
|
||||
$workbook->add_format(array('v_align' => 'center', 'h_align' => 'center', 'border' => 1)));
|
||||
$worksheet->write(28, 0, 'Top', $workbook->add_format(array('align' => 'top', 'border' => 1)));
|
||||
$worksheet->set_row(28, 25);
|
||||
$worksheet->write(29, 0, 'Vcenter', $workbook->add_format(array('align'=>'vcenter', 'border'=>1)));
|
||||
$worksheet->write(29, 0, 'Vcenter', $workbook->add_format(array('align' => 'vcenter', 'border' => 1)));
|
||||
$worksheet->set_row(29, 25);
|
||||
$worksheet->write(30, 0, 'Bottom', $workbook->add_format(array('align'=>'bottom', 'border'=>1)));
|
||||
$worksheet->write(30, 0, 'Bottom', $workbook->add_format(array('align' => 'bottom', 'border' => 1)));
|
||||
$worksheet->set_row(30, 25);
|
||||
$worksheet->write(28, 1, 'Left', $workbook->add_format(array('align'=>'left', 'border'=>1)));
|
||||
$worksheet->write(29, 1, 'Center', $workbook->add_format(array('align'=>'center', 'border'=>1)));
|
||||
$worksheet->write(30, 1, 'Right', $workbook->add_format(array('align'=>'right', 'border'=>1)));
|
||||
$worksheet->write(28, 1, 'Left', $workbook->add_format(array('align' => 'left', 'border' => 1)));
|
||||
$worksheet->write(29, 1, 'Center', $workbook->add_format(array('align' => 'center', 'border' => 1)));
|
||||
$worksheet->write(30, 1, 'Right', $workbook->add_format(array('align' => 'right', 'border' => 1)));
|
||||
|
||||
$worksheet->write(32, 0, 'Number formats', $miniheading);
|
||||
$worksheet->set_row(32, 20);
|
||||
$worksheet->set_row(33, 5);
|
||||
|
||||
$worksheet->write_string(34, 0, '1: 0');
|
||||
$worksheet->write_number(34, 1, 1003.14159, array('num_format'=>1));
|
||||
$worksheet->write_number(34, 1, 1003.14159, array('num_format' => 1));
|
||||
$worksheet->write_string(35, 0, '2: 0.00');
|
||||
$worksheet->write_number(35, 1, 1003.14159, array('num_format'=>2));
|
||||
$worksheet->write_number(35, 1, 1003.14159, array('num_format' => 2));
|
||||
$worksheet->write_string(36, 0, '3: #,##0');
|
||||
$worksheet->write_number(36, 1, 1003.14159, array('num_format'=>3));
|
||||
$worksheet->write_number(36, 1, 1003.14159, array('num_format' => 3));
|
||||
$worksheet->write_string(37, 0, '3: #,##0.00');
|
||||
$worksheet->write_number(37, 1, 1003.14159, array('num_format'=>4));
|
||||
$worksheet->write_number(37, 1, 1003.14159, array('num_format' => 4));
|
||||
$worksheet->write_string(38, 0, '11: 0.00E+00');
|
||||
$worksheet->write_number(38, 1, 3.14159, array('num_format'=>11));
|
||||
$worksheet->write_number(38, 1, 3.14159, array('num_format' => 11));
|
||||
$worksheet->write_string(39, 0, '12: # ?/?');
|
||||
$worksheet->write_number(39, 1, 3.14, array('num_format'=>12));
|
||||
$worksheet->write_number(39, 1, 3.14, array('num_format' => 12));
|
||||
$worksheet->write_string(40, 0, '13: # ??/??');
|
||||
$worksheet->write_number(40, 1, 3.14, array('num_format'=>13));
|
||||
$worksheet->write_number(40, 1, 3.14, array('num_format' => 13));
|
||||
$worksheet->write_string(41, 0, '15: d-mmm-yy');
|
||||
$worksheet->write_date(41, 1, time(), array('num_format'=>15));
|
||||
$worksheet->write_date(41, 1, time(), array('num_format' => 15));
|
||||
$worksheet->write_string(42, 0, '22: m/d/yy h:mm');
|
||||
$worksheet->write_date(42, 1, time(), array('num_format'=>22));
|
||||
$worksheet->write_date(42, 1, time(), array('num_format' => 22));
|
||||
|
||||
|
||||
|
||||
$worksheet->write(2, 3, 'Borders', $miniheading);
|
||||
|
||||
$worksheet->write(4, 3, 'Left', $workbook->add_format(array('left'=>'1')));
|
||||
$worksheet->write(6, 3, 'Bottom', $workbook->add_format(array('bottom'=>'1')));
|
||||
$worksheet->write(8, 3, 'Right', $workbook->add_format(array('right'=>'1')));
|
||||
$worksheet->write(10, 3, 'Top', $workbook->add_format(array('top'=>'1')));
|
||||
$worksheet->write(12, 3, 'Thick borders', $workbook->add_format(array('border'=>'2')));
|
||||
$worksheet->write(4, 3, 'Left', $workbook->add_format(array('left' => '1')));
|
||||
$worksheet->write(6, 3, 'Bottom', $workbook->add_format(array('bottom' => '1')));
|
||||
$worksheet->write(8, 3, 'Right', $workbook->add_format(array('right' => '1')));
|
||||
$worksheet->write(10, 3, 'Top', $workbook->add_format(array('top' => '1')));
|
||||
$worksheet->write(12, 3, 'Thick borders', $workbook->add_format(array('border' => '2')));
|
||||
|
||||
|
||||
$worksheet->write(14, 3, 'Background colours', $miniheading);
|
||||
|
||||
$worksheet->write(16, 3, 'Yellow', $workbook->add_format(array('bg_color'=>'yellow')));
|
||||
$worksheet->write(17, 3, 'Red', $workbook->add_format(array('bg_color'=>'red')));
|
||||
$worksheet->write(18, 3, 'Green', $workbook->add_format(array('bg_color'=>'green')));
|
||||
$worksheet->write(19, 3, 'Blue', $workbook->add_format(array('bg_color'=>12)));
|
||||
$worksheet->write(20, 3, 'Cyan', $workbook->add_format(array('bg_color'=>'#00FFFF')));
|
||||
$worksheet->write(16, 3, 'Yellow', $workbook->add_format(array('bg_color' => 'yellow')));
|
||||
$worksheet->write(17, 3, 'Red', $workbook->add_format(array('bg_color' => 'red')));
|
||||
$worksheet->write(18, 3, 'Green', $workbook->add_format(array('bg_color' => 'green')));
|
||||
$worksheet->write(19, 3, 'Blue', $workbook->add_format(array('bg_color' => 12)));
|
||||
$worksheet->write(20, 3, 'Cyan', $workbook->add_format(array('bg_color' => '#00FFFF')));
|
||||
|
||||
|
||||
$worksheet->write(25, 3, 'Cell merging', $miniheading);
|
||||
|
||||
$worksheet->merge_cells(27, 3, 28, 3);
|
||||
$worksheet->write(27, 3, 'Vertical merging of cells', $workbook->add_format(array('bg_color'=>'silver')));
|
||||
$worksheet->write(27, 3, 'Vertical merging of cells', $workbook->add_format(array('bg_color' => 'silver')));
|
||||
|
||||
$worksheet->merge_cells(30, 3, 30, 4);
|
||||
$worksheet->write(30, 3, 'Horizontal merging of cells',
|
||||
$workbook->add_format(array('pattern'=>1, 'bg_color'=>'silver')));
|
||||
$workbook->add_format(array('pattern' => 1, 'bg_color' => 'silver')));
|
||||
$worksheet->set_column(4, 4, 5);
|
||||
|
||||
$worksheet->set_row(44, null, null, true);
|
||||
$worksheet->write(44, 0, 'Hidden row', array('bg_color'=>'yellow'));
|
||||
$worksheet->write(44, 0, 'Hidden row', array('bg_color' => 'yellow'));
|
||||
|
||||
$worksheet->set_column(5, 5, null, null, true);
|
||||
$worksheet->write(0, 5, 'Hidden column', array('bg_color'=>'yellow'));
|
||||
$worksheet->write(0, 5, 'Hidden column', array('bg_color' => 'yellow'));
|
||||
|
||||
|
||||
$worksheet->write(45, 0, 'Outline row 1');
|
||||
@@ -235,26 +236,26 @@ $worksheet->set_column(7, 7, 20, null, false, 2);
|
||||
|
||||
$worksheet2 = $workbook->add_worksheet('Unsupported');
|
||||
$worksheet2->write(0, 0, 'Incomplete and missing features',
|
||||
$workbook->add_format(array('size'=>20, 'bold'=>1, 'italic'=>1)));
|
||||
$workbook->add_format(array('size' => 20, 'bold' => 1, 'italic' => 1)));
|
||||
$worksheet2->set_row(0, 25);
|
||||
$worksheet2->set_column(1, 1, 25);
|
||||
|
||||
$worksheet2->write(3, 1, 'Gray row - buggy');
|
||||
$worksheet2->set_row(3, null, array('bg_color'=>'silver'));
|
||||
$worksheet2->set_row(3, null, array('bg_color' => 'silver'));
|
||||
$worksheet2->write(2, 6, 'Gray column - buggy');
|
||||
$worksheet2->set_column(6, 6, 20, array('bg_color'=>'silver'));
|
||||
$worksheet2->set_column(6, 6, 20, array('bg_color' => 'silver'));
|
||||
|
||||
$worksheet2->hide_gridlines();
|
||||
|
||||
$worksheet2->write(5, 0, 'Outline text - not implemented', array('outline'=>1));
|
||||
$worksheet2->write(6, 0, 'Shadow text - not implemented', array('outline'=>1));
|
||||
$worksheet2->write(5, 0, 'Outline text - not implemented', array('outline' => 1));
|
||||
$worksheet2->write(6, 0, 'Shadow text - not implemented', array('outline' => 1));
|
||||
|
||||
$worksheet2->write(8, 0, 'Pattern 1');
|
||||
$worksheet2->write_blank(8, 1, array('pattern'=>1));
|
||||
$worksheet2->write_blank(8, 1, array('pattern' => 1));
|
||||
$worksheet2->write(9, 0, 'Pattern 2');
|
||||
$worksheet2->write_blank(9, 1, array('pattern'=>2));
|
||||
$worksheet2->write_blank(9, 1, array('pattern' => 2));
|
||||
$worksheet2->write(10, 0, 'Pattern 3');
|
||||
$worksheet2->write_blank(10, 1, array('pattern'=>3));
|
||||
$worksheet2->write_blank(10, 1, array('pattern' => 3));
|
||||
|
||||
|
||||
// Other worksheet tests follow.
|
||||
|
||||
Reference in New Issue
Block a user