Hi;
how to create button and method to import Excel file?
Xml
<button name="import_xls" string="Import" type="object" />
Py
import base64
import xlrd
xls_file = fields.Binary('File')
def import_xls(self):
wb = xlrd.open_workbook(file_contents=base64.decodestring(self.xls_file))
for sheet in wb.sheets():
for row in range(sheet.nrows):
for col in range(sheet.ncols):
print (sheet.cell(row,col).value)
If helpful you , upvote this.
Create an account today to enjoy exclusive features and engage with our awesome community!
साइन अप करें| Related Posts | Replies | डेटा देखने का तरीका | ऐक्टिविटी | |
|---|---|---|---|---|
|
2
सित॰ 23
|
2849 | |||
|
1
जुल॰ 18
|
5976 | |||
|
0
मार्च 15
|
5550 | |||
|
1
अग॰ 25
|
2658 | |||
|
0
नव॰ 24
|
6144 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.