Announcement Announcement Module
No announcement yet.
simpleformcontroller: export form search results into multiple csv files Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • simpleformcontroller: export form search results into multiple csv files


    i'm working on a search form in which you have a typical filtered search for users.

    by submitting it, you get the same page, with now the (pre)filled form on top of the table with results.

    what i was asked to add is the possibility to export those search results into a comma-separated-value file (csv).

    i've already worked on a controller that deals with querying data and it uses a view with "application/csv" as content type.
    so what happens now is you get your browser asking you what to do with the csv file (and you save it).

    response.setHeader("Content-disposition", "attachment; filename=export.csv");
    now, i was asked to have a limit the number of rows (welcome to excel limits!) and so split the results exporting into multiple files.

    i need some cool ideas on how to start doing that in a smart way.

    i thought about saving the files in tmp folder on my app server, maybe even zip them and then return the zip file in the view so to let the user able to download it.

    that's as far as i've gone so far.

    any little idea or hint will be much appreciated.