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.
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
2
sept. 23
|
2759 | |||
|
1
iul. 18
|
5905 | |||
|
0
mar. 15
|
5476 | |||
|
1
aug. 25
|
2542 | |||
|
0
nov. 24
|
6038 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.