Re: [web2py] Download a CSV file for a table

2012-10-30 Thread hasan alnator
its working now , the problem is i didnt add a response header : response.headers['Content-Type']='application/vnd.ms-excel' regards, On Tue, Oct 30, 2012 at 10:36 AM, Hassan Alnatour < halna...@gardeniatelco.com> wrote: > Dear ALL, > > I have this code for my CMS , am trying to make a butt

[web2py] Download a CSV file for a table

2012-10-30 Thread Hassan Alnatour
Dear ALL, I have this code for my CMS , am trying to make a button that downloads a csv file for the table auth_event , i did this : def UserEvents(): import cStringIO file = cStringIO.StringIO() db(db.auth_event.id >0).select(orderby=~db.auth_event.id).export_to_csv_file(file)