Bug 49381 - Documentation error - createFreezePane
Documentation error - createFreezePane
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: HSSF
3.7-FINAL
All All
: P2 normal (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-06-03 14:06 UTC by JDS
Modified: 2011-03-18 12:39 UTC (History)
1 user (show)



Attachments
Test case (1.30 KB, text/plain)
2011-01-30 22:36 UTC, Giorgio Gallo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JDS 2010-06-03 14:06:20 UTC
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.
Comment 1 Nick Burch 2010-06-04 11:42:47 UTC
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.
Comment 2 Giorgio Gallo 2011-01-16 21:35:52 UTC
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);
Comment 3 Nick Burch 2011-01-17 06:52:36 UTC
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
Comment 4 Giorgio Gallo 2011-01-30 22:36:15 UTC
Created attachment 26578 [details]
Test case
Comment 5 Giorgio Gallo 2011-01-30 22:37:49 UTC
Test case is attached.

(sorry for taking so long, Nick - I forgot to add myself as a watcher)
Comment 6 Nick Burch 2011-03-18 12:39:18 UTC
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.