enabling the field enclosure property on csv export in rest v2

​jasperserver-remote/src/main/java/com/jaspersoft/jasperserver/remote/exporters/CsvExporter.java

currently has:

    @Override
    public void configureExporter(JRExporter exporter, HashMap exportParameters) throws Exception {
        if (exportParams != null && exportParams.getFieldDelimiter() != null) {
            exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, exportParams.getFieldDelimiter());
        }
    }

​Adding the line below also doesn't work because of deprecated code

exporter.setParameter(JRCsvExporterParameter.FIELD_ENCLOSURE, exportParams.getFieldEnclosure());


Changing the code to this, results in no report being generated via the api. When I just comment out the line with exporter.setConfiguration(configuration); then it generates. So it looks like this setConfiguration is doing more than just setting the 2 parameters.

    @Override
    public void configureExporter(JRExporter exporter, HashMap exportParameters) throws Exception {
        if (exportParams != null) {
                SimpleCsvExporterConfiguration configuration = new SimpleCsvExporterConfiguration();
                configuration.setFieldDelimiter("~");
                configuration.setFieldEnclosure("=");
                exporter.setConfiguration(configuration);
        }

​Anybody an idea on how to enable the FieldEnclosure parameter on csv via Rest V2?

f1outsourcing's picture
Joined: Oct 20 2015 - 9:06am
Last seen: 6 years 6 months ago

0 Answers:

No answers yet
Feedback
randomness