I want to put this data in the following form using xlsxwriter, any help please?
'my_list': [ {'field1': 'xxxxx', 'field2': [ {'A': 'xxxx_01', 'B': 100 }, {'A': 'xxxx_02', 'B': 200 }, {'A': 'xxxx_03', 'B': 300 }, {'A': 'xxxx_04', 'B': 400 }, ] } ]
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to put this data in the following form using xlsxwriter, any help please?
'my_list': [ {'field1': 'xxxxx', 'field2': [ {'A': 'xxxx_01', 'B': 100 }, {'A': 'xxxx_02', 'B': 200 }, {'A': 'xxxx_03', 'B': 300 }, {'A': 'xxxx_04', 'B': 400 }, ] } ]
Hi,
Try like following
row = 6
for record in my_list:
row_mem = row
for rec in record['field2']:
sheet.write(row, 1, rec['A'])
sheet.write(row, 2, rec['B'])
row += 1
sheet.merge_range(row_mem, 0, row-1, 0, record['field1'])
Regards
i understand well you get this data
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 5 23
|
3993 | ||
|
0
thg 9 24
|
1424 | ||
|
0
thg 3 18
|
3542 | ||
|
0
thg 7 17
|
7836 | ||
|
1
thg 11 16
|
2980 |
If i understand well you get this data let's say from odoo db and want to put them inside the excel sheet ?
@ABDOU NASSER, Yes I want to do it by using sheet.write_column(....) , but still having problem.Thanks.