Package com.extentech.ExtenXLS

Examples of com.extentech.ExtenXLS.WorkBookHandle


   * ------------------------------------------------------------
   *
   */
  public void testit() {
    Logger.logInfo("====================== TESTING borders on cells ======================");
        WorkBookHandle tbo = new WorkBookHandle();
        try{
      WorkSheetHandle sheet = tbo.getWorkSheet(0);
     
            int[] coords = {12,1,12,5};
            CellRange range = new CellRange(sheet, coords, true);
           
            CellRange range2= new CellRange("Sheet1!B2:Sheet1!C10", tbo, true);
View Full Code Here


     * Reads in the default file
     * ------------------------------------------------------------
     *
     */
    public void testRead() {
        book = new WorkBookHandle(wd + finpath);
    }
View Full Code Here

                fos.flush();
                fos.close();
             
            }
           
            book = new WorkBookHandle(wd + foutpath);
           
        } catch (Exception e){
            Logger.logErr("Exception in Excel2007Test.",e);
       
    }
View Full Code Here


    public static void main(String[] args){
      Compare2Spreadsheets t1 = new Compare2Spreadsheets();
     
      WorkBookHandle bk1 = new WorkBookHandle("test_diff.xlsx");
      WorkBookHandle bk2 = new WorkBookHandle("test_diff2.xlsx");
     
      try {
      t1.testCompare2Spreadsheets(bk1, bk2);
    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

*/
public class testPasswordProtect{
  static String wd = System.getProperty("user.dir")+"/docs/samples/PasswordProtection/";

  public static void main(String[] args) {
    WorkBookHandle book = new WorkBookHandle();
    try{
      WorkSheetHandle sheet = book.getWorkSheet("Sheet1");
      CellHandle a1 = sheet.add("hello world","a1");
      sheet.setProtected(true);
        writeFile(book, "testPasswordProtect.xls");
            book.close();
        book = new WorkBookHandle(wd+"testPasswordProtect.xls");
            sheet = book.getWorkSheet("Sheet1");
            if(!sheet.getProtected())
              Logger.logErr("Set Password Protection Failed!");
           
            // set password/get password
            sheet.setProtectionPassword("g0away");
View Full Code Here

   * Reads in from a CSV file and Writes to System.out the Spreadsheet as CSV.
   *
   * @param args
   */
  public static void main(String[] args) {
    WorkBookHandle book = null;
    try{ // generate a PDF and confirm
      // load the current file and output it to same directory
      book = new WorkBookHandle(System.getProperty("user.dir") + "/docs/samples/Input_CSV/contacts.csv");
      System.out.println(book.getStats());
      Logger.logInfo("Successfully read CSV into spreadsheet: " +book);
    }catch(Exception e){
      Logger.logErr("Spreadsheet_CSV_Input failed.",e);
    }
   
    // Write out the spreadsheet as CSV --
        try {
            WorkSheetHandle wsh = null;
        wsh = book.getWorkSheet(0);
        StringBuffer arr = new StringBuffer();
            // return WorkBookCommander.returnXMLErrorResponse("PluginSheet.get() failed: "+ex.toString());
            RowHandle[] rwx = wsh.getRows();
            for (int i=0;i<rwx.length;i++) {
                RowHandle r = rwx[i];
View Full Code Here

   */
  public static void main(String[] args) {
    try{
      Logger.logInfo("Begin Demo of Printer Settings...");
      // load the current file and output it to same directory
      WorkBookHandle bk = new WorkBookHandle(System.getProperty("user.dir") + "/docs/samples/PrinterSettings/InvoiceTemplate.xls");
     
      // execute the printer settings methods on the book
      PrinterSettingsDemo demo = new PrinterSettingsDemo();
      demo.testPrinterSettings(bk);
     
      Logger.logInfo("Successfully Set Printer Settings for Spreadsheet: " + bk.toString());
    }catch(Exception e){
      Logger.logErr("Spreadsheet Printer Settings Demo failed.",e);
    }
   
   
View Full Code Here

     * adds values to a worksheet, then
     * creates a cell range to demonstrate various
     * merging methods
     * */
    public void mergeCells(){
        WorkBookHandle book = new WorkBookHandle();
        WorkSheetHandle sheet = null;
        try{
            sheet = book.getWorkSheet(0);
        }catch(WorkSheetNotFoundException e){
            System.err.println("Error getting worksheet " + e);
        }
       
        // add values to the worksheet
View Full Code Here

   
    // write it out
    testWrite(book, "PrinterSettings_out.xls");
   
    // read it in
    book = new WorkBookHandle(this.outputdir + "PrinterSettings_out.xls");
    try{
       sheet = book.getWorkSheet(0);
       printersetup = sheet.getPrinterSettings();
    }catch(Exception e){
      Logger.logErr("testPrinterSettings failed: " + e.toString());
View Full Code Here

       
  }
    WorkSheetHandle sheet = null;
   
  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);
View Full Code Here

TOP

Related Classes of com.extentech.ExtenXLS.WorkBookHandle

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.