Package com.extentech.ExtenXLS

Examples of com.extentech.ExtenXLS.FormatHandle


           
            CellRange range2= new CellRange("Sheet1!B2:Sheet1!C10", tbo, true);
            range2.setBorder(2,FormatConstants.BORDER_THIN, Color.blue);
           
            // set top and bottom
            FormatHandle myfmthandle = new FormatHandle(tbo);
            myfmthandle.addCellRange(range);
          myfmthandle.setTopBorderLineStyle(FormatHandle.BORDER_DOUBLE);
          myfmthandle.setBottomBorderLineStyle(FormatHandle.BORDER_THICK);
         
            // set sides
          int[] coords2 = {5,4,5,8};
          CellRange range3 = new CellRange(sheet, coords2, true);
            FormatHandle myfmthandle2 = new FormatHandle(tbo);
            myfmthandle2.addCellRange(range3);
          myfmthandle2.setBorderLeftColor(Color.red);
            myfmthandle2.setLeftBorderLineStyle(FormatHandle.BORDER_DASH_DOT_DOT);
           
            myfmthandle2.setBorderRightColor(Color.blue);
            myfmthandle2.setRightBorderLineStyle(FormatHandle.BORDER_DOUBLE);
         
            // ok, test not clobbering
            CellRange range4 = new CellRange(sheet, coords2, true);
           
            CellHandle cell0 = range4.getCells()[0];
          
            FormatHandle clobberfmt = cell0.getFormatHandle();
            clobberfmt.setCellBackgroundColor(Color.lightGray);
            clobberfmt.setUnderlined(true);
           
            cell0.setVal("hello world!");
           
           
    }catch(Exception ex) {
View Full Code Here


   
  void testBorders(String finpath, String sheetname){
    WorkBookHandle tbo = new WorkBookHandle(finpath);
    try{
      sheet = tbo.getWorkSheet(sheetname);
      FormatHandle fmt1 = new FormatHandle(tbo);
      fmt1.setFont("Arial",Font.PLAIN,24);
       fmt1.setForegroundColor(FormatHandle.COLOR_LIGHT_BLUE);
       fmt1.setFontColor(FormatHandle.COLOR_YELLOW);
       fmt1.setBackgroundPattern(FormatHandle.PATTERN_HOR_STRIPES3);

      fmt1.setBorderLineStyle(FormatHandle.BORDER_MEDIUM_DASH_DOT_DOT);
      sheet.add("NEW CELL!","C5");
      CellHandle bordercell = sheet.getCell("C3");
   
      int i = bordercell.getFormatId();
      fmt1.addCell(bordercell);
      i = bordercell.getFormatId();
      System.out.println(i);
    }catch(Exception e){System.out.println(e);}
    testWrite(tbo, "testFormats_out.xls");
  }
View Full Code Here

   
  void testFormats(String finpath, String sheetname){   
    WorkBookHandle tbo = new WorkBookHandle(finpath);

    int color = 5, patern = 25;
    FormatHandle fmt1 = new FormatHandle(tbo);
    fmt1.setFont("Arial",Font.PLAIN,10);
    fmt1.setForegroundColor(FormatHandle.COLOR_LIGHT_BLUE);
    fmt1.setFontColor(FormatHandle.COLOR_YELLOW);
    fmt1.setBackgroundPattern(FormatHandle.PATTERN_HOR_STRIPES3);
    FormatHandle fmt2 = new FormatHandle(tbo);
    try{
      sheet = tbo.getWorkSheet(sheetname);

      // TEST BORDERS
      CellHandle bordercell = sheet.getCell("C3");
      int borderfmt = bordercell.getFormatId();
     
      sheet.add("MODDY BORDER", "A10");
      bordercell = sheet.getCell("A10");
      FormatHandle fmx = new FormatHandle(tbo);
      fmx.setBorderLineStyle(3);
      fmx.setBorderTopColor(FormatHandle.COLOR_LIGHT_BLUE);
      fmx.setBorderBottomColor(FormatHandle.COLOR_GREEN);
      fmx.setBorderLeftColor(FormatHandle.COLOR_YELLOW);
      fmx.setBorderRightColor(FormatHandle.COLOR_BLACK);
      fmx.addCell(sheet.add("Great new cell!!", "A1"));
      fmx.setFont("Courier",Font.BOLD,12);
      fmx.setForegroundColor(FormatHandle.COLOR_BRIGHT_GREEN);
      fmx.setBackgroundColor(FormatHandle.COLOR_BLUE);
      fmx.setFontColor(FormatHandle.COLOR_BLUE);
      fmx.setBackgroundPattern(FormatHandle.PATTERN_HOR_STRIPES3);

      CellHandle cell1 = null;
      sheet.setHeaderText("Extentech Inc.");
      sheet.setFooterText("Created by ExtenXLS:" + WorkBookHandle.getVersion());
      String addr = "";
View Full Code Here

    sets this row to have a thick top border
  */
    public void setHasThickTopBorder(boolean hasBorder){
      this.fBorderTop = hasBorder;
      if (hasBorder) {
        FormatHandle fh= new FormatHandle(null, this.getXfRec());
        fh.setTopBorderLineStyle(FormatHandle.BORDER_THICK);
        ixfe= fh.getFormatId();
        myxf= null// reset
      }
      fGhostDirty= true;
    }
View Full Code Here

     * sets this row to have a thick bottom border
     */
    public void setHasThickBottomBorder(boolean hasBorder){
      this.fBorderBottom = hasBorder;
      if (hasBorder) {
        FormatHandle fh= new FormatHandle(null, this.getXfRec());
        fh.setBottomBorderLineStyle(FormatHandle.BORDER_THICK);
        ixfe= fh.getFormatId();
        myxf= null; // reset
      }
      fGhostDirty= true;
    }
View Full Code Here

TOP

Related Classes of com.extentech.ExtenXLS.FormatHandle

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.