Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pyexcelerate freeze panes

XlsxWriter has a method of adding frozen panes to an excel file:

import xlsxwriter

workbook = xlsxwriter.Workbook('frozen_panes.xlsx')
worksheet1 = workbook.add_worksheet('Panes 1')
worksheet1.freeze_panes(1, 0)

However, I have to use Pyexcelerate, and I can't find anything in their docs related to froze panes. Does Pyexcelerate have a similar method which would allow me to add frozen panes?

like image 891
jonesne Avatar asked Oct 18 '25 13:10

jonesne


2 Answers

To whom it may concern:

The solution was to get a worksheet and add a Pane with the option freeze = true.

The class Pane can be seen here:

https://github.com/kz26/PyExcelerate/blob/dev/pyexcelerate/Panes.py

like image 132
JeD Avatar answered Oct 21 '25 02:10

JeD


import pyexcelerate
wb = pyexcelerate.Workbook()
ws = wb.new_sheet("sheet name")
# suppose you want to freeze rows 1-2 and columns A-D
rows = 2
columns = 4
ws.panes = pyexcelerate.Panes(columns, rows) # note order versus set_cell_value
wb.save("example_freeze_panes.xlsx")
like image 37
Richard C Yeh Avatar answered Oct 21 '25 01:10

Richard C Yeh