Skip to Content
Menu
This question has been flagged
1109 Views

I working on the hr leave report by department, I have an overwrite problem when I select more than one department in my xlsx report, I do not know what is wrong with this loop

here is my loop :

for rows, i in enumerate(res):
print(i)
col=0
sheet.write(rows + 4, col, i['dept'], format2)
#rows+1
for j in i['data']:
print(j)
for rows ,k in enumerate(j['display']):
print(k)
sheet.write(ro + 3, col, k\.department_id\.name,\ format2\)
\ \ \ \ \ \ \ \ \ \ \ \ sheet\.write\(rows\ \+\ 4,\ col\ \+\ 1,\ k\.employee_id\.name,\ format2\)
\ \ \ \ \ \ \ \ \ \ \ \ sheet\.write\(rows\ \+\ 4,\ col\ \+\ 2,\ k\.date_from,\ format\)
\ \ \ \ \ \ \ \ \ \ \ \ sheet\.write\(rows\+\ 4,\ col\ \+\ 3,\ k\.date_to,\ format\)
\ \ \ \ \ \ \ \ \ \ \ \ sheet\.write\(rows\ \+\ 4,\ col\ \+\ 4,\ k.holiday_status_id.name, format2)
rows+ 1



Avatar
Discard