Development

HowToExportTabularData (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of HowToExportTabularData

Show
Ignore:
Author:
francois (IP: 62.240.242.149)
Timestamp:
02/02/06 16:05:14 (12 years ago)
Comment:

creation

Legend:

Unmodified
Added
Removed
Modified
  • HowToExportTabularData

    v0 v1  
     1= Symfony Howto: Export tabular data to a csv file? = 
     2 
     3I have a mymodule/myaction that outputs csv (i.e. tabular data separated by ;). If I want to point to it and have my users open it with Excel as a spreadsheet, I need to do a few things: 
     4 
     5 * add a special routing rule for mymodule/myaction which specifies a custom suffix 
     6 
     7{{{ 
     8export_excel: 
     9  url:    /export.csv 
     10  param:  {module: mymodule, action: myaction} 
     11}}} 
     12 * if I use mod_rewrite, add a new rule to the .htaccess to ignore the .csv files 
     13 
     14{{{ 
     15RewriteCond %{REQUEST_URI} !\.csv$ 
     16}}} 
     17 * declare the mymodeule/myaction view with a special content-type in the view.yml 
     18 
     19{{{ 
     20myactionSuccess: 
     21  has_layout: off 
     22  http_metas: 
     23    content-type: application/msexcel 
     24}}} 
     25