tealeg / xlsx

Go library for reading and writing XLSX files.
Other
5.84k stars 816 forks source link

Freeze panes and contribute to wiki #639

Closed moritz-biersack closed 3 years ago

moritz-biersack commented 3 years ago

Just started to use the library and really like the way it works!

One thing I need is to freeze panes, e.g. lock a header row/column in place while scrolling the sheet. I came up with the following solution:

 pane := xlsx.Pane{
    XSplit: 1, // lock rows
    YSplit: 1, // lock columns
    TopLeftCell: "B2", // Cell shown in the scrollable area
    ActivePane: "topRight",
    State: "frozen",
}
sheetView := xlsx.SheetView{Pane: &pane}

// Set the SheetViews of an existing xlsx.Sheet
sheet.SheetViews = []xlsx.SheetView{sheetView}

Probably this could be interesting for other users of the library, too. So I would like to add an example to the wiki but am not sure about how I can contribute, as the wiki is read only (and there are no pull requests for wikis).

For now I've forked the wiki and added my changes here: https://github.com/moritz-biersack/xlsx-wiki/blob/forzen-panes-example/FreezePanes.md

Please have a look and let me know, if I can do anything. Thank you!

tealeg commented 3 years ago

Hi @moritz-biersack - thanks so much for that. I've merged your changes into the Wiki. I've really no idea how this is supposed to work, or why you can't make a PR for a wiki change.

tealeg commented 3 years ago

Ah, @moritz-biersack, I think I've worked out how to make the Wiki editable by people without giving them commit rights on the repo. Thanks for the heads up on that one BTW.

moritz-biersack commented 3 years ago

Cool! Thank YOU @tealeg