Siddharth Koul
Siddharth Koul

Reputation: 15

Using CSV exporter in NatTable

I've ExcelExporter working in my code but I'm not able to utilize CSVExporter along with it.

I have been able to utilize my extended version of ExcelExporter by registering it with extended ExportCommandHandler. But not have been able to utilize the CSVExporter. Does CSVExporter also work on ExportCommand and how to utilize it? If possible please send a reference to examples.

Upvotes: 0

Views: 65

Answers (1)

Dirk Fauth
Dirk Fauth

Reputation: 4231

I don't understand what you mean with "I have been able to utilize my extended version of ExcelExporter by registering it with extended ExportCommandHandler". It should not be necessary to create custom command handler.

Using the CsvExporter is simply done by configuring it via ConfigRegistry like this:

natTable.addConfiguration(new AbstractRegistryConfiguration() {
    @Override
    public void configureRegistry(IConfigRegistry configRegistry) {
        configRegistry.registerConfigAttribute(
                ExportConfigAttributes.EXPORTER,
                new CsvExporter());

    }
});

Upvotes: 1

Related Questions