Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4397 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 16
5696
7
thg 6 20
20722
2
thg 5 16
5137
0
thg 9 15
5495
0
thg 3 15
4945