In sonata it is possible to export list views to different file formats e.g. excel, pdf or csv ...
This export is based on the database query running in the background. It does not consider that maybe a template is manipulating the output in the list view. For example if a timestamp is saved in the database and this field is added via
$listMapper->add('testdate', 'date', ['format' => 'y-m-d'])
on the listview its correct displayed as "2017-10-01" but in the export there is something like "2489489289" in this column...
Another example: if i render a custom column representing a state based on different properties of the current object, the state column will never appear in the exported file.
Maybe a possible solution to me could be to override the admin controller and add a custom callback function to render the export file manual.
But here is one big problem:
I have to implement the whole logic for showing the columns in the expected format also in the exporting callback function.
Is there an elegant way to achieve this? What i actually want is an export of the current list view "as it is" and not based on the database query in the background ...
Thanks