You are here

public function XlsxExporter::writeHeader in Webform XLSX export 8

Throws

\PhpOffice\PhpSpreadsheet\Exception

Overrides WebformExporterBase::writeHeader

File

src/Plugin/WebformExporter/XlsxExporter.php, line 68

Class

XlsxExporter
Class XlsxExporter.

Namespace

Drupal\webform_xlsx_export\Plugin\WebformExporter

Code

public function writeHeader() {
  $sheet = $this->xls
    ->getActiveSheet();
  foreach ($this
    ->buildHeader() as $column => $header) {
    $sheet
      ->setCellValueByColumnAndRow($column + 1, 1, $header);
  }
  $sheet
    ->getStyle('A1:' . $sheet
    ->getHighestColumn() . '1')
    ->getFont()
    ->setBold(TRUE);
}