Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add sheet name for each datasheet in an XLS file generated from "tablib"?

Tags:

python

I want to convert some data in my database to XLS (Excel) format. I used tablib to do this and can get the Excel sheets in the proper format.

How do I specify names for individual sheets in my Excel file?

like image 903
sankalp Avatar asked Aug 17 '12 11:08

sankalp


1 Answers

When exporting to Excel, the sheets have names from the Dataset.title property (source code).

You can set the title in the Dataset constructor:

dataset = Dataset(title="Sheet name")
like image 56
codeape Avatar answered Oct 14 '22 13:10

codeape