Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cannot get Export to CSV to work in EE

    Hi there,

    I'm having a hard time getting the export functionality to work of a ListGrid.

    My DataSource has a custom data url set, and for the export action I have this code:

    Code:
    DSRequest dsRequestProperties = new DSRequest();
    			dsRequestProperties.setExportAs(ExportFormat.CSV);
    			dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
    grid.exportData(dsRequestProperties);
    Pretty much exactly like in the showcase.

    However, when I actuall call this function I get this error:
    Code:
    http://localhost:8888/datasource.ds/Results.csv?isc_rpc=1&isc_v=SC_SNAPSHOT-2010-02-23&isc_tnum=1
    Where the "datasource.ds" is the URL I set as a DataURL of the datasource.

    Three questions:
    1. Should this work OOTB with a custom datasource?
    2. How do I control which URL is called if I have to (if it doesn't work OOTB)
    3. If it doesn't work OOTB for custom data sources, what do I have to call server or client side to get the exact same results as the regular datasource functionality?

    Regards,

    Kees.

    #2
    It does work out of the box with a custom DataSource, however it requires that the servlet you are pointing to is registered in web.XML with a wildcard URL pattern similarly to the builtin IDACall servlet, such that the client is allowed to add a filename to the export URL. This is the only way to get certain browsers to recognize the intended exportFileName.

    Comment

    Working...
    X