1 16 17 22 package org.apache.poi.hssf.usermodel; 23 24 import org.apache.poi.ddf.EscherRecord; 25 import org.apache.poi.hssf.model.Sheet; 26 import org.apache.poi.hssf.model.Workbook; 27 import org.apache.poi.hssf.record.*; 28 import org.apache.poi.hssf.util.Region; 29 import org.apache.poi.util.POILogFactory; 30 import org.apache.poi.util.POILogger; 31 32 import java.io.PrintWriter ; 33 import java.util.ArrayList ; 34 import java.util.Iterator ; 35 import java.util.List ; 36 import java.util.TreeMap ; 37 38 45 46 public class HSSFSheet 47 { 48 private static final int DEBUG = POILogger.DEBUG; 49 50 51 public static final short LeftMargin = Sheet.LeftMargin; 52 public static final short RightMargin = Sheet.RightMargin; 53 public static final short TopMargin = Sheet.TopMargin; 54 public static final short BottomMargin = Sheet.BottomMargin; 55 56 public static final byte PANE_LOWER_RIGHT = (byte)0; 57 public static final byte PANE_UPPER_RIGHT = (byte)1; 58 public static final byte PANE_LOWER_LEFT = (byte)2; 59 public static final byte PANE_UPPER_LEFT = (byte)3; 60 61 62 67 68 public final static int INITIAL_CAPACITY = 20; 69 70 73 74 private Sheet sheet; 75 private TreeMap rows; 76 private Workbook book; 77 private int firstrow; 78 private int lastrow; 79 private static POILogger log = POILogFactory.getLogger(HSSFSheet.class); 80 81 88 89 protected HSSFSheet(Workbook book) 90 { 91 sheet = Sheet.createSheet(); 92 rows = new TreeMap (); this.book = book; 94 } 95 96 104 105 protected HSSFSheet(Workbook book, Sheet sheet) 106 { 107 this.sheet = sheet; 108 rows = new TreeMap (); 109 this.book = book; 110 setPropertiesFromSheet(sheet); 111 } 112 113 HSSFSheet cloneSheet(Workbook book) { 114 return new HSSFSheet(book, sheet.cloneSheet()); 115 } 116 117 118 121 122 private void setPropertiesFromSheet(Sheet sheet) 123 { 124 int sloc = sheet.getLoc(); 125 RowRecord row = sheet.getNextRow(); 126 127 while (row != null) 128 { 129 createRowFromRecord(row); 130 131 row = sheet.getNextRow(); 132 } 133 sheet.setLoc(sloc); 134 CellValueRecordInterface cval = sheet.getNextValueRecord(); 135 long timestart = System.currentTimeMillis(); 136 137 if (log.check( POILogger.DEBUG )) 138 log.log(DEBUG, "Time at start of cell creating in HSSF sheet = ", 139 new Long (timestart)); 140 HSSFRow lastrow = null; 141 142 while (cval != null) 143 { 144 long cellstart = System.currentTimeMillis(); 145 HSSFRow hrow = lastrow; 146 147 if ( ( lastrow == null ) || ( lastrow.getRowNum() != cval.getRow() ) ) 148 { 149 hrow = getRow( cval.getRow() ); 150 } 151 if ( hrow != null ) 152 { 153 lastrow = hrow; 154 if (log.check( POILogger.DEBUG )) 155 log.log( DEBUG, "record id = " + Integer.toHexString( ( (Record) cval ).getSid() ) ); 156 hrow.createCellFromRecord( cval ); 157 cval = sheet.getNextValueRecord(); 158 if (log.check( POILogger.DEBUG )) 159 log.log( DEBUG, "record took ", 160 new Long ( System.currentTimeMillis() - cellstart ) ); 161 } 162 else 163 { 164 cval = null; 165 } 166 } 167 if (log.check( POILogger.DEBUG )) 168 log.log(DEBUG, "total sheet cell creation took ", 169 new Long (System.currentTimeMillis() - timestart)); 170 } 171 172 180 public HSSFRow createRow(int rownum) 181 { 182 HSSFRow row = new HSSFRow(book, sheet, rownum); 183 184 addRow(row, true); 185 return row; 186 } 187 188 194 195 private HSSFRow createRowFromRecord(RowRecord row) 196 { 197 HSSFRow hrow = new HSSFRow(book, sheet, row); 198 199 addRow(hrow, false); 200 return hrow; 201 } 202 203 208 209 public void removeRow(HSSFRow row) 210 { 211 sheet.setLoc(sheet.getDimsLoc()); 212 if (rows.size() > 0) 213 { 214 rows.remove(row); 215 if (row.getRowNum() == getLastRowNum()) 216 { 217 lastrow = findLastRow(lastrow); 218 } 219 if (row.getRowNum() == getFirstRowNum()) 220 { 221 firstrow = findFirstRow(firstrow); 222 } 223 Iterator iter = row.cellIterator(); 224 225 while (iter.hasNext()) 226 { 227 HSSFCell cell = (HSSFCell) iter.next(); 228 229 sheet.removeValueRecord(row.getRowNum(), 230 cell.getCellValueRecord()); 231 } 232 sheet.removeRow(row.getRowRecord()); 233 } 234 } 235 236 239 240 private int findLastRow(int lastrow) 241 { 242 int rownum = lastrow - 1; 243 HSSFRow r = getRow(rownum); 244 245 while (r == null && rownum > 0) 246 { 247 r = getRow(--rownum); 248 } 249 if (r == null) 250 return -1; 251 return rownum; 252 } 253 254 257 258 private int findFirstRow(int firstrow) 259 { 260 int rownum = firstrow + 1; 261 HSSFRow r = getRow(rownum); 262 263 while (r == null && rownum <= getLastRowNum()) 264 { 265 r = getRow(++rownum); 266 } 267 268 if (rownum > getLastRowNum()) 269 return -1; 270 271 return rownum; 272 } 273 274 279 280 private void addRow(HSSFRow row, boolean addLow) 281 { 282 rows.put(row, row); 283 if (addLow) 284 { 285 sheet.addRow(row.getRowRecord()); 286 } 287 if (row.getRowNum() > getLastRowNum()) 288 { 289 lastrow = row.getRowNum(); 290 } 291 if (row.getRowNum() < getFirstRowNum()) 292 { 293 firstrow = row.getRowNum(); 294 } 295 } 296 297 303 304 public HSSFRow getRow(int rownum) 305 { 306 HSSFRow row = new HSSFRow(); 307 308 row.setRowNum( rownum); 310 return (HSSFRow) rows.get(row); 311 } 312 313 316 317 public int getPhysicalNumberOfRows() 318 { 319 return rows.size(); 320 } 321 322 326 327 public int getFirstRowNum() 328 { 329 return firstrow; 330 } 331 332 336 337 public int getLastRowNum() 338 { 339 return lastrow; 340 } 341 342 347 348 public void setColumnWidth(short column, short width) 349 { 350 sheet.setColumnWidth(column, width); 351 } 352 353 358 359 public short getColumnWidth(short column) 360 { 361 return sheet.getColumnWidth(column); 362 } 363 364 369 370 public short getDefaultColumnWidth() 371 { 372 return sheet.getDefaultColumnWidth(); 373 } 374 375 380 381 public short getDefaultRowHeight() 382 { 383 return sheet.getDefaultRowHeight(); 384 } 385 386 391 392 public float getDefaultRowHeightInPoints() 393 { 394 return (sheet.getDefaultRowHeight() / 20); 395 } 396 397 402 403 public void setDefaultColumnWidth(short width) 404 { 405 sheet.setDefaultColumnWidth(width); 406 } 407 408 413 414 public void setDefaultRowHeight(short height) 415 { 416 sheet.setDefaultRowHeight(height); 417 } 418 419 424 425 public void setDefaultRowHeightInPoints(float height) 426 { 427 sheet.setDefaultRowHeight((short) (height * 20)); 428 } 429 430 434 435 public boolean isGridsPrinted() 436 { 437 return sheet.isGridsPrinted(); 438 } 439 440 444 445 public void setGridsPrinted(boolean value) 446 { 447 sheet.setGridsPrinted(value); 448 } 449 450 455 456 public int addMergedRegion(Region region) 457 { 458 return sheet.addMergedRegion( region.getRowFrom(), 460 region.getColumnFrom(), 461 region.getRowTo(), 463 region.getColumnTo()); 464 } 465 466 470 471 public void setVerticallyCenter(boolean value) 472 { 473 VCenterRecord record = 474 (VCenterRecord) sheet.findFirstRecordBySid(VCenterRecord.sid); 475 476 record.setVCenter(value); 477 } 478 479 482 483 public boolean getVerticallyCenter(boolean value) 484 { 485 VCenterRecord record = 486 (VCenterRecord) sheet.findFirstRecordBySid(VCenterRecord.sid); 487 488 return record.getVCenter(); 489 } 490 491 495 496 public void setHorizontallyCenter(boolean value) 497 { 498 HCenterRecord record = 499 (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid); 500 501 record.setHCenter(value); 502 } 503 504 507 508 public boolean getHorizontallyCenter() 509 { 510 HCenterRecord record = 511 (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid); 512 513 return record.getHCenter(); 514 } 515 516 517 518 522 523 public void removeMergedRegion(int index) 524 { 525 sheet.removeMergedRegion(index); 526 } 527 528 532 533 public int getNumMergedRegions() 534 { 535 return sheet.getNumMergedRegions(); 536 } 537 538 543 544 public Region getMergedRegionAt(int index) 545 { 546 return new Region(sheet.getMergedRegionAt(index)); 547 } 548 549 553 554 public Iterator rowIterator() 555 { 556 return rows.values().iterator(); 557 } 558 559 564 565 protected Sheet getSheet() 566 { 567 return sheet; 568 } 569 570 574 575 public void setAlternativeExpression(boolean b) 576 { 577 WSBoolRecord record = 578 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 579 580 record.setAlternateExpression(b); 581 } 582 583 587 588 public void setAlternativeFormula(boolean b) 589 { 590 WSBoolRecord record = 591 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 592 593 record.setAlternateFormula(b); 594 } 595 596 600 601 public void setAutobreaks(boolean b) 602 { 603 WSBoolRecord record = 604 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 605 606 record.setAutobreaks(b); 607 } 608 609 613 614 public void setDialog(boolean b) 615 { 616 WSBoolRecord record = 617 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 618 619 record.setDialog(b); 620 } 621 622 627 628 public void setDisplayGuts(boolean b) 629 { 630 WSBoolRecord record = 631 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 632 633 record.setDisplayGuts(b); 634 } 635 636 640 641 public void setFitToPage(boolean b) 642 { 643 WSBoolRecord record = 644 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 645 646 record.setFitToPage(b); 647 } 648 649 653 654 public void setRowSumsBelow(boolean b) 655 { 656 WSBoolRecord record = 657 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 658 659 record.setRowSumsBelow(b); 660 } 661 662 666 667 public void setRowSumsRight(boolean b) 668 { 669 WSBoolRecord record = 670 (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid); 671 672 record.setRowSumsRight(b); 673 } 674 675 679 680 public boolean getAlternateExpression() 681 { 682 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 683 .getAlternateExpression(); 684 } 685 686 690 691 public boolean getAlternateFormula() 692 { 693 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 694 .getAlternateFormula(); 695 } 696 697 701 702 public boolean getAutobreaks() 703 { 704 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 705 .getAutobreaks(); 706 } 707 708 712 713 public boolean getDialog() 714 { 715 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 716 .getDialog(); 717 } 718 719 724 725 public boolean getDisplayGuts() 726 { 727 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 728 .getDisplayGuts(); 729 } 730 731 735 736 public boolean getFitToPage() 737 { 738 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 739 .getFitToPage(); 740 } 741 742 746 747 public boolean getRowSumsBelow() 748 { 749 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 750 .getRowSumsBelow(); 751 } 752 753 757 758 public boolean getRowSumsRight() 759 { 760 return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid)) 761 .getRowSumsRight(); 762 } 763 764 768 public boolean isPrintGridlines() { 769 return getSheet().getPrintGridlines().getPrintGridlines(); 770 } 771 772 777 public void setPrintGridlines( boolean newPrintGridlines ) 778 { 779 getSheet().getPrintGridlines().setPrintGridlines( newPrintGridlines ); 780 } 781 782 786 public HSSFPrintSetup getPrintSetup() 787 { 788 return new HSSFPrintSetup( getSheet().getPrintSetup() ); 789 } 790 791 795 public HSSFHeader getHeader() 796 { 797 return new HSSFHeader( getSheet().getHeader() ); 798 } 799 800 804 public HSSFFooter getFooter() 805 { 806 return new HSSFFooter( getSheet().getFooter() ); 807 } 808 809 813 public void setSelected( boolean sel ) 814 { 815 getSheet().setSelected( sel ); 816 } 817 818 823 public double getMargin( short margin ) 824 { 825 return getSheet().getMargin( margin ); 826 } 827 828 833 public void setMargin( short margin, double size ) 834 { 835 getSheet().setMargin( margin, size ); 836 } 837 838 842 public boolean getProtect() { 843 return getSheet().getProtect().getProtect(); 844 } 845 846 850 public void setProtect(boolean protect) { 851 getSheet().getProtect().setProtect(protect); 852 } 853 854 862 public void setZoom( int numerator, int denominator) 863 { 864 if (numerator < 1 || numerator > 65535) 865 throw new IllegalArgumentException ("Numerator must be greater than 1 and less than 65536"); 866 if (denominator < 1 || denominator > 65535) 867 throw new IllegalArgumentException ("Denominator must be greater than 1 and less than 65536"); 868 869 SCLRecord sclRecord = new SCLRecord(); 870 sclRecord.setNumerator((short)numerator); 871 sclRecord.setDenominator((short)denominator); 872 getSheet().setSCLRecord(sclRecord); 873 } 874 875 884 protected void shiftMerged(int startRow, int endRow, int n, boolean isRow) { 885 List shiftedRegions = new ArrayList (); 886 for (int i = 0; i < this.getNumMergedRegions(); i++) { 888 Region merged = this.getMergedRegionAt(i); 889 890 boolean inStart = (merged.getRowFrom() >= startRow || merged.getRowTo() >= startRow); 891 boolean inEnd = (merged.getRowTo() <= endRow || merged.getRowFrom() <= endRow); 892 893 if (! (inStart && inEnd)) continue; 895 896 if (!merged.contains(startRow-1, (short)0) && !merged.contains(endRow+1, (short)0)){ 898 merged.setRowFrom(merged.getRowFrom()+n); 899 merged.setRowTo(merged.getRowTo()+n); 900 shiftedRegions.add(merged); 902 this.removeMergedRegion(i); 903 i = i -1; 905 } 906 907 } 908 909 Iterator iterator = shiftedRegions.iterator(); 911 while (iterator.hasNext()) { 912 Region region = (Region)iterator.next(); 913 914 this.addMergedRegion(region); 915 } 916 917 } 918 919 933 public void shiftRows( int startRow, int endRow, int n ) { 934 shiftRows(startRow, endRow, n, false, false); 935 } 936 937 953 public void shiftRows( int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight) 954 { 955 int s, e, inc; 956 if ( n < 0 ) 957 { 958 s = startRow; 959 e = endRow; 960 inc = 1; 961 } 962 else 963 { 964 s = endRow; 965 e = startRow; 966 inc = -1; 967 } 968 969 shiftMerged(startRow, endRow, n, true); 970 sheet.shiftRowBreaks(startRow, endRow, n); 971 972 for ( int rowNum = s; rowNum >= startRow && rowNum <= endRow && rowNum >= 0 && rowNum < 65536; rowNum += inc ) 973 { 974 HSSFRow row = getRow( rowNum ); 975 HSSFRow row2Replace = getRow( rowNum + n ); 976 if ( row2Replace == null ) 977 row2Replace = createRow( rowNum + n ); 978 979 HSSFCell cell; 980 981 982 983 984 for ( short col = row2Replace.getFirstCellNum(); col <= row2Replace.getLastCellNum(); col++ ) 986 { 987 cell = row2Replace.getCell( col ); 988 if ( cell != null ) 989 row2Replace.removeCell( cell ); 990 } 991 if (row == null) continue; else { 993 if (copyRowHeight) { 994 row2Replace.setHeight(row.getHeight()); 995 } 996 997 if (resetOriginalRowHeight) { 998 row.setHeight((short)0xff); 999 } 1000 } 1001 for ( short col = row.getFirstCellNum(); col <= row.getLastCellNum(); col++ ) 1002 { 1003 cell = row.getCell( col ); 1004 if ( cell != null ) 1005 { 1006 row.removeCell( cell ); 1007 CellValueRecordInterface cellRecord = cell.getCellValueRecord(); 1008 cellRecord.setRow( rowNum + n ); 1009 row2Replace.createCellFromRecord( cellRecord ); 1010 sheet.addValueRecord( rowNum + n, cellRecord ); 1011 } 1012 } 1013 } 1014 if ( endRow == lastrow || endRow + n > lastrow ) lastrow = Math.min( endRow + n, 65535 ); 1015 if ( startRow == firstrow || startRow + n < firstrow ) firstrow = Math.max( startRow + n, 0 ); 1016 } 1017 1018 protected void insertChartRecords( List records ) 1019 { 1020 int window2Loc = sheet.findFirstRecordLocBySid( WindowTwoRecord.sid ); 1021 sheet.getRecords().addAll( window2Loc, records ); 1022 } 1023 1024 1031 public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow ) 1032 { 1033 if (colSplit < 0 || colSplit > 255) throw new IllegalArgumentException ("Column must be between 0 and 255"); 1034 if (rowSplit < 0 || rowSplit > 65535) throw new IllegalArgumentException ("Row must be between 0 and 65535"); 1035 if (leftmostColumn < colSplit) throw new IllegalArgumentException ("leftmostColumn parameter must not be less than colSplit parameter"); 1036 if (topRow < rowSplit) throw new IllegalArgumentException ("topRow parameter must not be less than leftmostColumn parameter"); 1037 getSheet().createFreezePane( colSplit, rowSplit, topRow, leftmostColumn ); 1038 } 1039 1040 1045 public void createFreezePane( int colSplit, int rowSplit ) 1046 { 1047 createFreezePane( colSplit, rowSplit, colSplit, rowSplit ); 1048 } 1049 1050 1063 public void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane ) 1064 { 1065 getSheet().createSplitPane( xSplitPos, ySplitPos, topRow, leftmostColumn, activePane ); 1066 } 1067 1068 1072 public void setDisplayGridlines(boolean show) { 1073 sheet.setDisplayGridlines(show); 1074 } 1075 1076 1080 public boolean isDisplayGridlines() { 1081 return sheet.isDisplayGridlines(); 1082 } 1083 1084 1088 public void setDisplayFormulas(boolean show) { 1089 sheet.setDisplayFormulas(show); 1090 } 1091 1092 1096 public boolean isDisplayFormulas() { 1097 return sheet.isDisplayFormulas(); 1098 } 1099 1100 1104 public void setDisplayRowColHeadings(boolean show) { 1105 sheet.setDisplayRowColHeadings(show); 1106 } 1107 1108 1112 public boolean isDisplayRowColHeadings() { 1113 return sheet.isDisplayRowColHeadings(); 1114 } 1115 1116 1120 public void setRowBreak(int row) { 1121 validateRow(row); 1122 sheet.setRowBreak(row, (short)0, (short)255); 1123 } 1124 1125 1130 public boolean isRowBroken(int row) { 1131 return sheet.isRowBroken(row); 1132 } 1133 1134 1138 public void removeRowBreak(int row) { 1139 sheet.removeRowBreak(row); 1140 } 1141 1142 1146 public int[] getRowBreaks(){ 1147 int[] returnValue = new int[sheet.getNumRowBreaks()]; 1149 Iterator iterator = sheet.getRowBreaks(); 1150 int i = 0; 1151 while (iterator.hasNext()) { 1152 PageBreakRecord.Break breakItem = (PageBreakRecord.Break)iterator.next(); 1153 returnValue[i++] = (int)breakItem.main; 1154 } 1155 return returnValue; 1156 } 1157 1158 1162 public short[] getColumnBreaks(){ 1163 short[] returnValue = new short[sheet.getNumColumnBreaks()]; 1165 Iterator iterator = sheet.getColumnBreaks(); 1166 int i = 0; 1167 while (iterator.hasNext()) { 1168 PageBreakRecord.Break breakItem = (PageBreakRecord.Break)iterator.next(); 1169 returnValue[i++] = breakItem.main; 1170 } 1171 return returnValue; 1172 } 1173 1174 1175 1179 public void setColumnBreak(short column) { 1180 validateColumn(column); 1181 sheet.setColumnBreak(column, (short)0, (short)65535); 1182 } 1183 1184 1189 public boolean isColumnBroken(short column) { 1190 return sheet.isColumnBroken(column); 1191 } 1192 1193 1197 public void removeColumnBreak(short column) { 1198 sheet.removeColumnBreak(column); 1199 } 1200 1201 1205 protected void validateRow(int row) { 1206 if (row > 65535) throw new IllegalArgumentException ("Maximum row number is 65535"); 1207 if (row < 0) throw new IllegalArgumentException ("Minumum row number is 0"); 1208 } 1209 1210 1214 protected void validateColumn(short column) { 1215 if (column > 255) throw new IllegalArgumentException ("Maximum column number is 255"); 1216 if (column < 0) throw new IllegalArgumentException ("Minimum column number is 0"); 1217 } 1218 1219 1223 public void dumpDrawingRecords() 1224 { 1225 sheet.aggregateDrawingRecords(book.getDrawingManager()); 1226 1227 EscherAggregate r = (EscherAggregate) getSheet().findFirstRecordBySid(EscherAggregate.sid); 1228 List escherRecords = r.getEscherRecords(); 1229 for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); ) 1230 { 1231 EscherRecord escherRecord = (EscherRecord) iterator.next(); 1232 PrintWriter w = new PrintWriter (System.out); 1233 escherRecord.display(w, 0); 1234 w.close(); 1235 } 1236 } 1237 1238 1244 public HSSFPatriarch createDrawingPatriarch() 1245 { 1246 book.createDrawingGroup(); 1248 1249 sheet.aggregateDrawingRecords(book.getDrawingManager()); 1250 EscherAggregate agg = (EscherAggregate) sheet.findFirstRecordBySid(EscherAggregate.sid); 1251 HSSFPatriarch patriarch = new HSSFPatriarch(this); 1252 agg.clear(); agg.setPatriarch(patriarch); 1255 return patriarch; 1256 } 1257 1258 1264 public void setColumnGroupCollapsed( short columnNumber, boolean collapsed ) 1265 { 1266 sheet.setColumnGroupCollapsed( columnNumber, collapsed ); 1267 } 1268 1269 1275 public void groupColumn(short fromColumn, short toColumn) 1276 { 1277 sheet.groupColumnRange( fromColumn, toColumn, true ); 1278 } 1279 1280 public void ungroupColumn( short fromColumn, short toColumn ) 1281 { 1282 sheet.groupColumnRange( fromColumn, toColumn, false ); 1283 } 1284 1285 public void groupRow(int fromRow, int toRow) 1286 { 1287 sheet.groupRowRange( fromRow, toRow, true ); 1288 } 1289 1290 public void ungroupRow(int fromRow, int toRow) 1291 { 1292 sheet.groupRowRange( fromRow, toRow, false ); 1293 } 1294 1295 public void setRowGroupCollapsed( int row, boolean collapse ) 1296 { 1297 sheet.setRowGroupCollapsed( row, collapse ); 1298 } 1299 1300 1301} 1302 | Popular Tags |