This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
In Build 184 (2015-01-31) they added: Lists now support exporting to CSV format via the default export controller action. Does anybody has en example how to use this?
I have a function onExport in my Controller, but I don't know how I to get the export.csv as download:
public function onExport(){ $this->export(); }
Last updated
I found a documentation https://github.com/thephpleague/csv/blob/gh-pages/examples.md , Did you find a solution?
Yes, it's quite simple. Controller:
public function export(){
return $this->listExportCsv(array('filename' => 'my.csv'));
}
For Download: site.lu/backend/acme/pluginName/controller/export
Hi Guys,
Can you explain this a bit more for me. i want a simple export button at the top of my list similar to a delete button. that when records are checked its enable and once clicked export the selected rows.
Could you please help me on this.
thanks
listExportCsv()
only takes data goes to listing and sends it to the CSV exporter. So the easiest way will be to implement some kind of filtering and then export filtrated dataset to CSV.
For more check http://octobercms.com/docs/backend/lists#list-filters
thanks.
Im now using the import/export feature and to export a cvs using exportData($columns, $sessionKey = null) etc.
However when it exports I'm left with data.cv.html (why the html extention?) And also if i try an open the file i get a warning saying excel has detected its a SYLK file and may be corrupt.
Any ideas. or has anyone successfully exported a list as a CSV using: https://octobercms.com/docs/backend/import-export
thanks
Just rename first column ID
to Id
, it's Microsoft error, when first two char of CSV are uppercase :-(
Vojta Svoboda said:
Just rename first column
ID
toId
, it's Microsoft error, when first two char of CSV are uppercase :-(
ᄏId Username Name Surname Email Registered
1 manju@gmail.com manju manju@gmail.com 2015-11-30 23:34:34
i get the above error in csv where extra chracter gets appended in the id column name and the first column which was supposed to be the id is empty
can you please tell the reason behind it
Try to rename this column to something different, maybe "Number". Otherwise I would create own export controller and own export model by http://octobercms.com/docs/backend/lists#list-filters
here is also one with an example, for user who need some help using examples ref: integrate-import-export-csv-backend-list-octobercms
Last updated
1-14 of 14