axlsx icon indicating copy to clipboard operation
axlsx copied to clipboard

Freeze Panes is not working

Open raghavendra-prithvi opened this issue 11 years ago • 2 comments

Hi, I have seen all the library code and I didn't find any code or existing method to use for the freeze top row. I need the header to be frozen for my application. Can anyone help me with this?

Thanks, Raghavendra

raghavendra-prithvi avatar Aug 21 '15 20:08 raghavendra-prithvi

The OOXML spec for Excel (and friends) is so large that I dont expect this library to have documented all the various options.

Fortunately, because an Excel xslx file is really just a zipped set of XML files, I have found that I can reverse engineer the needed Ruby calls by generating an Excel doc (in Excel) and then inspecting the resultant XML and translating those calls to Axlsx method calls.

I have written a blog post about how to do this here: http://ruckus.tumblr.com/post/125987714941/reverse-engineering-excel-xml

ruckus avatar Nov 24 '15 23:11 ruckus

Hi discovered panes need selections too in excel 2013 - axslx selections don not seem well documented but got this working as per below #freeze panes in right place @sheet.sheet_view.pane do |pane| pane.top_left_cell = "C9" pane.state = :frozen pane.x_split = 2 pane.y_split = 8 pane.active_pane = :bottom_right end @sheet.sheet_view.add_selection :top_right , :active_cell => "C1", :sqref => "C1" @sheet.sheet_view.add_selection :bottom_left , :active_cell => "A9", :sqref => "A9" @sheet.sheet_view.add_selection :bottom_right , :active_cell => "C9", :sqref => "C9"

jontyD avatar Jun 17 '16 11:06 jontyD