excel in django


excel in django



How can i make user to downlaoad a excel from the django app.i HAVE A MODEL WHICH gives the report.Now i want a option from user can download the file in excel form.ANy Solution




How can I use django forms/models to represent choices between fields?

1:



Can I use a database view as a model in Django?
You can output the data as .csv which is easily imported into MS Excel.
http://docs.djangoproject.com/en/dev/howto/outputting-csv/.
How to repeat a “block” in a django template
EDIT
After I wrote that I got curious if there actually was some way to do it directly to excel format and found:
http://www.python-excel.org/
That made me wonder why you didn't google your question before posted it here......
How do I implement a common interface for Django related object sets?


Django: retrieving abstract-derived models


Add row to inlines dynamically in django admin

2:



Is there a way to auto-increment a Django field with respect to a foreign key?
I'm not sure quite what you're asking.


Is there any reason why you can't compare a template filter to a string in Django template syntax?
If you're asking how can you generate output that's able to be read into Excel, IMO your best bet is using a CSV (see amoeba's response) as that's pretty generic.

There are ways of using true Excel formats as well.. I'm thinking though that perhaps you're asking how you can have a user click a link (or whatever) and have Excel pop up with your data in it? (IOW, you've already generated the output).. I suppose I'd say a few things: 1) It shouldn't be specific to Excel, many users use things like OO.o (thus my CSV suggestion) 2) It's going to vary depending on their browser and how they have it set up.

Personally, I don't like pages opening up the "proper application" so I turn all of that off - other people enable it..



83 out of 100 based on 83 user ratings 983 reviews