Package org.zkoss.poi.ss.util

Examples of org.zkoss.poi.ss.util.AreaReference


   * @param sheet the {@link Worksheet} the Range will refer to.
   * @param reference the area the Range will refer to (e.g. "A1:D4").
   * @return the associated {@link Range} of the specified {@link Worksheet} and area reference string (e.g. "A1:D4").
   */
  public static Range range(Worksheet sheet, String reference) {
    AreaReference ref = getAreaReference(sheet, reference);
    if (ref == null) {
      //try NamedRange
      final Workbook wb = sheet.getWorkbook();
        final Name range = wb.getName(reference);
        if (range != null) {
View Full Code Here


    final String c1str = (sheet1 != null ? sheet1 : "") + (sheet2 != null ? (":" + sheet2) : "") + (sheet1 != null ? "!" : "") + lt;
    final SpreadsheetVersion ver = ((Book)sheet.getWorkbook()).getSpreadsheetVersion()
    final int maxcol = ver.getLastColumnIndex();
    final int maxrow = ver.getLastRowIndex();

    AreaReference ref = null;
    try {
      final CellReference c1 = new CellReference(c1str);
      if (c1.getCol() <= maxcol && c1.getRow() <= maxrow) {
        final CellReference c2 = rb != null ? new CellReference(rb) : c1;
        if (rb != null) {
          if (c2.getCol() <= maxcol && c2.getRow() <= maxrow) {
            ref = new AreaReference(c1, c2);
          }
        } else {
          ref = new AreaReference(c1, c2);
        }
      }
    } catch(Exception ex) {
      //ignore, return null ref and let upper case do it!
    }
View Full Code Here

      exporter.export(book, outputStream);
    } else if (seld == currSelection){
      Rect rect = selection;
      String area = ss.getColumntitle(rect.getLeft()) + ss.getRowtitle(rect.getTop()) + ":" +
        ss.getColumntitle(rect.getRight()) + ss.getRowtitle(rect.getBottom());
      exporter.exportSelection(ss.getSelectedSheet(), new AreaReference(area), outputStream);
    } else
      exporter.export(ss.getSelectedSheet(), outputStream);
  }
View Full Code Here

      exporter.export(book, outputStream);
    } else if (seld == currSelection){
      Rect rect = ss.getSelection();
      String area = ss.getColumntitle(rect.getLeft()) + ss.getRowtitle(rect.getTop()) + ":" +
        ss.getColumntitle(rect.getRight()) + ss.getRowtitle(rect.getBottom());
      exporter.exportSelection(ss.getSelectedSheet(), new AreaReference(area), outputStream);
    } else {
      exporter.export(ss.getSelectedSheet(), outputStream);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.util.AreaReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.