Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4328 Vizualizări

I want to generate an excel file with only field name and to download the same excel file on button click.The button should be inside the form view.I am using version 10

Imagine profil
Abandonează
Autor

@Haresh kansara yes i have created the excel file now i want to download it on the same click

Cel mai bun răspuns

Hello,

You can do like this.

Take one Binary field in model for storing XLS file like

file = fields.Binary('Label', filters='.xls', readonly=True)

and then do code when you have prepared file:

temp_file = base64.encodestring(prepared_file)

self.write({'file': temp_file})

# make sure convert prepared file based on content type

Accept and upvote answer if helpful

Thanks and Regards

Haresh Kansara

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
nov. 16
5687
7
iun. 20
20666
2
mai 16
5118
0
sept. 15
5477
0
mar. 15
4932