caxlsx / caxlsx_rails

A Rails plugin to provide templates for the axlsx gem
MIT License
744 stars 84 forks source link

Freeze panels in Excel 2016 for MacOs and Windows #110

Closed StefanGies99 closed 5 years ago

StefanGies99 commented 5 years ago

Hi,

I'm currently facing to a bug with the freeze functionality inside this gem. When I open the xlsx export with Google docs or other sheet tools the functionality is working fine. However when I open the export with Excel 2016 on both MacOs or Windows I get a problem alert about recovering the file.

Do you already have a solution for this problem or is there a bypass so I can also add support for Excel 2016?

I used the following split functionality for freezing the top row and the first 3 columns:

 sheet.sheet_view.pane do |pane|
      pane.top_left_cell = 'A1'
      pane.state = :frozen_split
      pane.y_split = 1
      pane.x_split = 3
      pane.active_pane = :bottom_left
    end

About versions: Rails 5.2.2 Ruby 2.5.3 Axlsx 3.0.0.pre Axlsx-rails 0.5.2

StefanGies99 commented 5 years ago

With a little bit reverse engineering I found out that some things have to be added to let the export work. Follow this link for more information: https://github.com/randym/axlsx/issues/413