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

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
                },
            ]
        }
        
    ]


아바타
취소

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.

베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
1
5월 23
3985
0
9월 24
1420
0
3월 18
3541
0
7월 17
7832
1
11월 16
2976