The documentation indicates that the last two arguments are column and row. According to bug #47964, this is the correct order, however the method creates a cell reference with the col/row backwards, causing the bottom of the documentation to be true, which says the row comes before column (contradicting the first line). From documentation: ================================================================ public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow) Creates a split (freezepane). Any existing freezepane or split pane is overwritten. Specified by: createFreezePane in interface Sheet Parameters: colSplit - Horizonatal position of split. rowSplit - Vertical position of split. topRow - Top row visible in bottom pane leftmostColumn - Left column visible in right pane.
The documentation was correct, but slightly confusing - you need to track the variable names, rather than blindly trusting the order of the params It's confusing though, so fixed in r951453.
Hi guys, I dare to reopen this issue, as docs & implementation still don't seem to agree in 1.7. A1 B1 | C1 ---------- A2 B2 | C2 // C2 is at col 2, row 1 According to the docs, in order to get a split at cell C2 I should use sheet.createFreezePane(2, 1, 2, 1); but indeed that does not work as expected, while this one does sheet.createFreezePane(2, 1, 1, 2);
Are you able to create a unit test that shows the result is wrong, or are you only able to verify the issue by loading the file in excel afterwards? If the former, please do create a unit test and upload it, so that can be used for testing the fix, and ensuring it stays correct into the future
Created attachment 26578 [details] Test case
Test case is attached. (sorry for taking so long, Nick - I forgot to add myself as a watcher)
Thanks for the test. It turns out that it was XSSF and not HSSF that was wrong - the two params were the wrong way round in a CellReference Fixed, and your unit test added, in r1082966.