You are here

public function XlsxExporter::writeSubmission in Webform XLSX export 8

Throws

\PhpOffice\PhpSpreadsheet\Exception

Overrides WebformExporterBase::writeSubmission

File

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

Class

XlsxExporter
Class XlsxExporter.

Namespace

Drupal\webform_xlsx_export\Plugin\WebformExporter

Code

public function writeSubmission(WebformSubmissionInterface $webform_submission) {
  $sheet = $this->xls
    ->getActiveSheet();
  $row = $sheet
    ->getHighestRow();
  foreach ($this
    ->buildRecord($webform_submission) as $column => $record) {
    $sheet
      ->setCellValueByColumnAndRow($column + 1, $row + 1, $record);
  }
}