Setting custom header on each page of an excel sheet using xlsxwriter

530 Views Asked by At

Is it possible to set custom header on each page within the same sheet in excel using xlsxwriter?

Here I get two pages, but the same header on each. So this just sets for the entire sheet.

import xlsxwriter

data = ["a", "b", "c"]
wb = xlsxwriter.Workbook('test.xlsx')
ws = wb.add_worksheet()

for index,d in enumerate(data):
    ws.write(index,0,d)
    ws.print_area(index,0,index,10)
    ws.set_header("&C Header %s"%d)
    ws.set_h_pagebreaks([index])                                         
ws.set_page_view()
wb.close()
0

There are 0 best solutions below