You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add style and columnWidth options to the ExcelOpenSpoutExporter (#368)
This adds an extra option on `AbstractColumn` to configure options
specific for an exporter. The available options are defined on the
exporter using `DataTableExporterInterface::configureColumnOptions()`.
The style option allows to set the OpenSpout cell style for a column.
The columnWidth sets the column width in the Excel sheet.
->setInfo('exporterOptions', 'Specific exporter options can be specified here, where the key is the exporter name and the value is an array of options.')
126
129
;
127
130
128
131
return$this;
@@ -245,4 +248,13 @@ public function isValidForSearch(mixed $value): bool
245
248
{
246
249
returntrue;
247
250
}
251
+
252
+
/**
253
+
* @param string $exporterName one of the exporter names as returned by DataTableExporterInterface::getName()
// Add a notice to the sheet if there is truncated data.
@@ -84,14 +95,19 @@ public function export(array $columnNames, \Iterator $data): \SplFileInfo
84
95
$writer
85
96
->addNewSheetAndMakeItCurrent()
86
97
->setName('Notice');
87
-
$writer->addRow(Row::fromValues(['Some cell values were too long! They were truncated to fit the 32,767 character limit.'], $boldStyle));
98
+
$writer->addRow(Row::fromValues(['Some cell values were too long! They were truncated to fit the 32,767 character limit.'], (newStyle())->setFontBold()));
0 commit comments