sonata-project/exporter

Make the writers configurable services

Closed this issue · 8 comments

My client wants to open their CSV files with Microsoft Excel or LibreOffice, but Excel does not automatically detect that commas are in used and defaults to SSV (Semicolon-separated values).

I think a way to fix that would be to make the CsvWriter configurable services (and the other writers while we're at it).

An ugly workaround is to create another Exporter configured with semicolons, and overwrite the service definition, like this :

    sonata.admin.exporter: # ugly service id override
        class: MyProject\AppBundle\Admin\Export\Exporter

Should this be done on a exporter-bundle or can be done easily through a bridge?

Oh right, this is not a bundle… I think a start would be to use DI instead of instanciating the writers in the class. The service is defined in the core bundle, so I guess this is where the second part should happen.

Wait… the class itself is defined in the admin-bundle, I'll reopen the issue there. I'm tired.

In fact everything is in the core bundle.

In fact everything is in the core bundle.

Maybe this can be move as a bridge integration here?

Not everybody is using export on admin-bundle, IMO we can make it optional with ease.

Have to check other bundle dependencies too.

@greg0ire Why closing?

It's not an exporter issue.