Write one blank somewhere in the worksheet.

@param integer $row    Zero indexed row
@param integer $col    Zero indexed column
@param mixed   $format The XF format for the cell
551235
public function write_blank($row, $col, $format = null) {
        $this->worksheet->setCellValueByColumnAndRow($col, $row+1, '');
        $this->apply_format($row, $col, $format);
    }
749679
public function setStyle($style, $column1, $row1, $column2 = null, $row2 = null)
    {
        $this->sheet->getStyleByColumnAndRow($column1, $row1, $column2, $row2)->applyFromArray($style);
    }
362179
public void addCell(String row, String col, String value) throws Exception {
		HeaderInfo rowIndex = rowLookup.get(row);
		HeaderInfo colIndex = columnLookup.get(col);
		if (rowIndex == null) {
			throw new Exception("Row " + row + " not found in worksheet");
		}
		if (colIndex == null) {
			throw new Exception("Column " + col + " not found in worksheet");
		}


		data[rowIndex.getIndex()][colIndex.getIndex()] = new CompactCharSequence(value);
	}
260558
public function row($r, $last = false)
	{
		$this->_strategy->output($this->beginRow());
		
		$values = array_values($r);
		$valuesl = count($values);
		
		for ( $i = 0 ; $i < $valuesl ; $i++ )
			$this->column($values[$i], $i+1 == $valuesl);
		
		$this->_strategy->output($this->endRow() . ($last ? '' : $this->rowSeparator()));
	}
745376
private function getCellWidth(array $row, $column) {
        $cellWidth = 0;

        if (isset($row[$column])) {
            $cell = $row[$column];
            $cellWidth = Console::strlenWithoutDecoration($this->output->getFormatter(), $cell);
        }

        $columnWidth = isset($this->columnWidths[$column]) ? $this->columnWidths[$column] : 0;

        return max($cellWidth, $columnWidth);
    }
407235
private function addCell($column, $data, $row, $header = false) {
        $c = $this->rowDefinition[$column];
        $data = $this->fetchDataByUserFunc($c, $data, $column, $row, $header, false);
        if ($this->trigger(self::EV_CELL_ADD, [$column, $data, $c, $row, $header]) === false) {
            $data = '';
        }
        if ($this->drawByUserFunc($data, $column, $row, $header) === false) {
            $h = $this->getRowHeight();
            if ((!$header && $c['isMultiLine']) || ($header && $c['isMultiLineHeader'])) {
                // for multicell, if maxh = null, set it to cell's height, so
                // vertical alignment can work
                $y = $this->pdf->GetY();
                if ($c['valign'] === 'M' && $c['isHtml'] && $this->rowDefinition['_content'][$column] < $h) {
                    // try to center vertically the best way we can the cell
                    // when it's html content
                    $pos = $y + (($h - $this->rowDefinition['_content'][$column]) / 2);
                    $h = $this->rowDefinition['_content'][$column];
                    $c['x'] = $this->pdf->GetX();
                    $c['y'] = $pos;
                }

                $this->pdf->MultiCell($c['width'], $h, $data, $c['border'],
                    $c['align'], $c['fill'], $c['ln'], $c['x'], $c['y'],
                    $c['reseth'], $c['stretch'], $c['isHtml'],
                    $c['autoPadding'], $c['maxh'] === null ? $h : $c['maxh'],
                    $c['valign'], $c['fitcell']);

                if ($c['isHtml']) {
                    // reset position after drawing the multicell html content
                    $x = $this->pdf->GetX();
                    $this->pdf->SetY($y);
                    $this->pdf->SetX($x);
                }
            } else {
                $this->pdf->Cell($c['width'], $h, $data, $c['border'],
                    $c['ln'], $c['align'], $c['fill'], $c['link'],
                    $c['stretch'], $c['ignoreHeight'], $c['calign'],
                    $c['valign']);
            }
        }
        $this->trigger(self::EV_CELL_ADDED, [$column, $data, $c, $row, $header]);
        return $this;
    }
981786
public function setColumnFormat($query_name, $format_type, $format_value)
    {

        $this->checkColumnName("set_column_format", $query_name);
        if ($cl = &ReporticoUtility::getQueryColumn($query_name, $this->columns)) {
            $col = &$cl;
            $col->setFormat($format_type, $format_value);
        }
    }
1131684
public function write_string($row, $col, $str, $format = null) {
        $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);
        $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $str, PHPExcel_Cell_DataType::TYPE_STRING);
        $this->apply_format($row, $col, $format);
    }
404623
public function writeRow(iterable $row): void
    {
        $str = Csv::dump($row, $this->delimiter, $this->enclosure, $this->escape);

        try {
            $written = $this->stream->write($str);
        } catch (\Throwable $e) {
            throw new \RuntimeException('Failed to write CSV row.', 0, $e);
        }

        if (strlen($str) !== $written) {
            throw new \RuntimeException('Failed to write CSV row.');
        }
    }
415747
public function write_date($row, $col, $date, $format = null) {
        $getdate = usergetdate($date);
        $exceldate = PHPExcel_Shared_Date::FormattedPHPToExcel(
            $getdate['year'],
            $getdate['mon'],
            $getdate['mday'],
            $getdate['hours'],
            $getdate['minutes'],
            $getdate['seconds']
        );

        $this->worksheet->setCellValueByColumnAndRow($col, $row+1, $exceldate);
        $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22);
        $this->apply_format($row, $col, $format);
    }
1181493
public function write_date($row, $col, $date, $format = null) {
        if (!isset($this->data[$row][$col])) {
            $this->data[$row][$col] = new MoodleODSCell();
        }
        if (is_array($format)) {
            $format = new MoodleODSFormat($format);
        }
        $this->data[$row][$col]->value = $date;
        $this->data[$row][$col]->type = 'date';
        $this->data[$row][$col]->format = $format;
        $this->data[$row][$col]->formula = null;
    }
860713
public static function rowcol( $row = 1, $col = 1 ) {
		$row = intval($row);
		$col = intval($col);
		if( $row < 0 ) {
			$row = Misc::rows() + $row + 1;
		}
		if( $col < 0 ) {
			$col = Misc::cols() + $col + 1;
		}
		fwrite(self::$stream, "\033[{$row};{$col}f");
	}
22010
public function write_formula($row, $col, $formula, $format = null) {
        $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
        $this->apply_format($row, $col, $format);
    }
306645
public function isEmpty($col, $row)
    {
        $this->checkCoords($col, $row);

        return self::NONE === $this->get($col, $row);
    }
400655
private function renderCell(array $row, $column, $cellFormat)
    {
        $cell = isset($row[$column]) ? $row[$column] : '';
        $width = $this->effectiveColumnWidths[$column];
        if ($cell instanceof TableCell && $cell->getColspan() > 1) {
            // add the width of the following columns(numbers of colspan).
            foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) {
                $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn];
            }
        }

        // str_pad won't work properly with multi-byte strings, we need to fix the padding
        if (false !== $encoding = mb_detect_encoding($cell, null, true)) {
            $width += strlen($cell) - mb_strwidth($cell, $encoding);
        }

        $style = $this->getColumnStyle($column);

        if ($cell instanceof TableSeparator) {
            return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width));
        }

        $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
        $content = sprintf($style->getCellRowContentFormat(), $cell);

        return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType()));
    }
1069434
public function createSheet(
        array $headers,
        array $rows,
        string $title
    ): void {
        // Check if we are setting any custom column widths.
        if ($this->hasColumnWidths()) {
            // We have a numeric index array, so create an array of letters that we can use to map to Excel columns.
            // e.g. 0 = A, 3 = D, etc.
            $columns = range('A', 'Z');

            $this->builder->applyColumnWidths($columns, $this->getColumnWidths());
        }

        // Style settings for agent headers
        $style = $this->builder->buildRowStyle([
            'alignment' => BuilderInterface::ALIGNMENT_CENTRE,
            'font'      => [
                'color' => [
                    'rgb' => BuilderInterface::COLOUR_BLACK_RGB,
                ],
                'bold'  => true,
            ],
        ]);

        // Build column headers.
        $this->builder->buildHeaderRow($headers, $style);

        // Build all the rows now.
        $this->builder->buildRows($rows);

        // If no column widths are specified, then simply auto-size all columns.
        if (!$this->hasColumnWidths()) {
            $this->builder->autoSizeColumns($rows[0]);
        }

        // Rename sheet.
        $this->builder->setSheetTitle($title);
    }
220217
function writeNote($row, $col, $note)
    {
        $note_length    = strlen($note);
        $record         = 0x001C;                // Record identifier
        $max_length     = 2048;                  // Maximun length for a NOTE record
        //$length      = 0x0006 + $note_length;    // Bytes to follow

        // Check that row and col are valid and store max and min values
        if ($row >= $this->_xls_rowmax) {
            return(-2);
        }
        if ($col >= $this->_xls_colmax) {
            return(-2);
        }
        if ($row <  $this->_dim_rowmin) {
            $this->_dim_rowmin = $row;
        }
        if ($row >  $this->_dim_rowmax) {
            $this->_dim_rowmax = $row;
        }
        if ($col <  $this->_dim_colmin) {
            $this->_dim_colmin = $col;
        }
        if ($col >  $this->_dim_colmax) {
            $this->_dim_colmax = $col;
        }

        // Length for this record is no more than 2048 + 6
        $length    = 0x0006 + min($note_length, 2048);
        $header    = pack("vv",   $record, $length);
        $data      = pack("vvv", $row, $col, $note_length);
        $this->_append($header . $data . substr($note, 0, 2048));

        for ($i = $max_length; $i < $note_length; $i += $max_length) {
            $chunk  = substr($note, $i, $max_length);
            $length = 0x0006 + strlen($chunk);
            $header = pack("vv",   $record, $length);
            $data   = pack("vvv", -1, 0, strlen($chunk));
            $this->_append($header.$data.$chunk);
        }
        return(0);
    }