Skip to content

Instantly share code, notes, and snippets.

@dotpot
Forked from randym/gist:1883637
Created February 22, 2012 09:47
Show Gist options
  • Save dotpot/1883672 to your computer and use it in GitHub Desktop.
Save dotpot/1883672 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