Package org.zkoss.zss.model.impl

Examples of org.zkoss.zss.model.impl.ExcelImporter


        throw new UiException("Must specify the src of the spreadsheet to create a new book");
      }
      try {
        Importer importer = _importer;
        if(importer == null){
          importer = new ExcelImporter();
        }

        if(importer instanceof ExcelImporter){
          URL url = null;
         
View Full Code Here


  /**
   * Test method for {@link jxl.read.biff.WorkbookParser#parse()}.
   */
  public void testVariableResolving() {
    final String nm = "var1.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("=ABCD.value.text", sheet1.getCell(0,0).getEditText());
    assertEquals("=ivan", sheet1.getCell(1,0).getEditText());
    assertEquals("=ivnulla", sheet1.getCell(2,0).getEditText());
   
View Full Code Here

  }
 
  public void testFunctionMapper() {
    final String nm = "fun1.xls";

    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("#NAME?", sheet1.getCell(0,0).getText());

    Map map = new HashMap();
    SimpleResolver resolver = new SimpleResolver(map);
View Full Code Here

  }
 
  public void testSpecialFunction2() {
    final String nm = "fun2.xls";

    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    Cell cellA1 = sheet1.getCell(0,0);
    assertEquals("=MROUND(10.0,3.0)", cellA1.getEditText());
    assertEquals("9", cellA1.getText());
   
View Full Code Here

  }
 
  public void testSpecialFunction3() {
    final String nm = "fun3.xls";

    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    Cell cellA1 = sheet1.getCell(0,0);
    assertEquals("=DB(3000000.0,200000.0,10.0,2.0,9.0)", cellA1.getEditText());
    Cell cellA2 = sheet1.getCell(1,0);
    assertEquals("=PMT(0.1/12.0,6.0,100000.0,2000.0,1.0)", cellA2.getEditText());
View Full Code Here

        return null;
      }
      try {
        Importer importer = _importer;
        if (importer == null) {
          importer = new ExcelImporter();
        }

        Book book = null;
        if (importer instanceof ExcelImporter) {
          URL url = null;
View Full Code Here

    _selectedSheetName = null;
    //bug#315: freezed pane rows/columns don't work when setting Spreadsheet from Composer.
    //setRowfreeze(-1);
    //setColumnfreeze(-1);
    //setBook(null);
    _importer = new ExcelImporter();
    _src=src;
    final Book book = ((ExcelImporter)_importer).imports(is, src);
    initBook(book);
    invalidate();
  }
View Full Code Here

   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book13.xls";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof HSSFBookImpl);
    assertTrue(_workbook instanceof HSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
    assertEquals("Sheet1", _workbook.getSheetName(0));
View Full Code Here

   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book8.xls";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof HSSFBookImpl);
    assertTrue(_workbook instanceof HSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
    assertEquals("Sheet1", _workbook.getSheetName(0));
View Full Code Here

   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book14.xlsx";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof XSSFBookImpl);
    assertTrue(_workbook instanceof XSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
    assertEquals("Sheet1", _workbook.getSheetName(0));
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.impl.ExcelImporter

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.