Nevermind, I believe I figured out the issue. If I do the createFreezePane(2,1,2,1), I get the strange behavior in Excel. However, if I do something like createFreezePane(2,1,3,2), it works ok. Probably something that you could never do in Excel itself, but POI allows you to do this, so you get the strange behavior.
Sorry for the bandwidth waste... Jason -----Original Message----- From: Goris, Jason [mailto:[email protected]] Sent: Monday, May 03, 2010 1:43 PM To: 'POI Users List' Subject: Help with Freeze Pane problem Hello, I am trying to get the createFreezePane() method working, but when I open the resulting Excel (2007) document (xlsx) and try to use the mouse scroll-wheel, the screen gets all garbled. Also, a couple of the rows appear to be missing when first opening the document until I cursor down once. I've tried setting the active cell, etc., but no dice on that either. I wrote a simple piece of code below that creates some rows and columns in a workbook/sheet and writes a file. When I open the file, the above issue happens. If anyone can see what I'm doing wrong, I'd appreciate it. I'm using the POI 3.6 (latest stable release) version in Java JDK 1.6.0_13. Sample code snippet: final Workbook wb2 = new XSSFWorkbook(); final Sheet sheet2 = wb2.createSheet(); sheet2.createFreezePane(2, 1, 2, 1); // 1=header row final Row dataRow20 = sheet2.createRow(0); final Cell dataCell200 = dataRow20.createCell(0); dataCell200.setCellValue("200"); final Cell dataCell201 = dataRow20.createCell(1); dataCell201.setCellValue(10.12); final Cell dataCell202 = dataRow20.createCell(2); dataCell202.setCellValue("TEST 200"); final Cell dataCell203 = dataRow20.createCell(3); dataCell203.setCellValue(new Date()); final Row dataRow21 = sheet2.createRow(1); final Cell dataCell210 = dataRow21.createCell(0); dataCell210.setCellValue("210"); final Cell dataCell211 = dataRow21.createCell(1); dataCell211.setCellValue(11.13); final Cell dataCell212 = dataRow21.createCell(2); dataCell212.setCellValue("TEST 210"); final Cell dataCell213 = dataRow21.createCell(3); dataCell213.setCellValue(new Date()); final Row dataRow22 = sheet2.createRow(2); final Cell dataCell220 = dataRow22.createCell(0); dataCell220.setCellValue("220"); final Cell dataCell221 = dataRow22.createCell(1); dataCell221.setCellValue(12.14); final Cell dataCell222 = dataRow22.createCell(2); dataCell222.setCellValue("TEST 220"); final Cell dataCell223 = dataRow22.createCell(3); dataCell223.setCellValue(new Date()); final Row dataRow23 = sheet2.createRow(3); final Cell dataCell230 = dataRow23.createCell(0); dataCell230.setCellValue("230"); final Cell dataCell231 = dataRow23.createCell(1); dataCell231.setCellValue(13.15); final Cell dataCell232 = dataRow23.createCell(2); dataCell232.setCellValue("TEST 230"); final Cell dataCell233 = dataRow23.createCell(3); dataCell233.setCellValue(new Date()); final Row dataRow24 = sheet2.createRow(4); final Cell dataCell240 = dataRow24.createCell(0); dataCell240.setCellValue("240"); final Cell dataCell241 = dataRow24.createCell(1); dataCell241.setCellValue(14.16); final Cell dataCell242 = dataRow24.createCell(2); dataCell242.setCellValue("TEST 240"); final Cell dataCell243 = dataRow24.createCell(3); dataCell243.setCellValue(new Date()); final FileOutputStream fileOut = new FileOutputStream("myworkbook.xlsx"); wb2.write(fileOut); fileOut.close(); Thanks, Jason This email may contain confidential or privileged material. Use or disclosure of it by anyone other than the recipient is unauthorized. If you are not an intended recipient, please delete this email. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] This email may contain confidential or privileged material. Use or disclosure of it by anyone other than the recipient is unauthorized. If you are not an intended recipient, please delete this email. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
