Skip to content

Instantly share code, notes, and snippets.

@randym
Created February 22, 2012 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save randym/1883637 to your computer and use it in GitHub Desktop.
Save randym/1883637 to your computer and use it in GitHub Desktop.
# In a controller
document = db.Text(template.render('tpl/estimate.xls',template_values),encoding="utf_8")
self.response.headers.add_header('Content-disposition', 'attachment; filename="'+seq+'.xls"')
self.response.headers.add_header('Content-type', 'application/vnd.ms-excel; filename="'+seq+'.xls"')
self.response.headers.add_header('name', seq+'.xls')
self.response.out.write(document)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment