콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4317 화면

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

아바타
취소
작성자

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

베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
2
11월 16
5686
7
6월 20
20661
2
5월 16
5116
0
9월 15
5475
0
3월 15
4932