i develop an application using web2py and i wanna to generate a csv file so i wanna to generate it but the columns will be row.
e.g: The file is generated as
name mobile email Address
yyy yyyyy yyy yyyyy
i wanna to the file to be generated as the following design:
name yyy
mobile yyyy
email yyyyyy
Address yyyy
how can i do this??
i used this code to generate the csv file:
i used this code to generate csv:
import gluon.contenttype
response.headers['Content-Type'] = \
gluon.contenttype.contenttype('.csv')
response.headers['Content-disposition'] = 'attachment; filename=members_approaching_renewal_report.csv'\ rows=db().select(db.member.membership_id,db.member.first_name,db.member.middle_name,db.member.last_name,db.member.birthdate,db.member.membership_status,db.member.registration_date,db.member.membership_end_date)
rows.colnames=('Membership Id','First Name','Middle Name','Last Name','Birthday Date','Membership Status','Registration Date','Membership ending Date')
return str(rows)
How to edit in this code to make what i want??
Thanks in Advance