Examples of ExcelSheet


Examples of loxia.support.excel.definition.ExcelSheet

        throw new RuntimeException("Initiate ExcelWriter[" + clazz + "] failure");
      }
    }
    ExcelManipulatorDefinition definition = new ExcelManipulatorDefinition();
    for(String sheet: sheets){
      ExcelSheet sheetDefinition = getExcelSheet(sheet);     
      definition.getExcelSheets().add(sheetDefinition);     
    }
    excelWriter.setDefinition(definition);
    if(writeTemplateName != null){
      if(excelWriter instanceof DefaultExcelWriter){
View Full Code Here

Examples of loxia.support.excel.definition.ExcelSheet

        throw new RuntimeException("Initiate ExcelReader[" + clazz + "] failure");
      }
    }
    ExcelManipulatorDefinition definition = new ExcelManipulatorDefinition();
    for(String sheet: sheets){
      ExcelSheet sheetDefinition = getExcelSheet(sheet);     
      definition.getExcelSheets().add(sheetDefinition);     
    }
    excelReader.setDefinition(definition);
    return excelReader;
  }
View Full Code Here

Examples of loxia.support.excel.definition.ExcelSheet

    return excelReader;
  }
 
  private ExcelSheet getExcelSheet(String sheet){
    if(BLANK_SHEET_DEF.equalsIgnoreCase(sheet)) return BLANK_SHEET;
    ExcelSheet sheetDefinition = sheetDefinitions.get(sheet);
    if(sheetDefinition == null)
      throw new RuntimeException("No sheet defintion found with name: " + sheet);
    return sheetDefinition.cloneSheet();
  }
View Full Code Here

Examples of loxia.support.excel.definition.ExcelSheet

      if(definition.getExcelSheets().size() == 0){
        readStatus.setStatus(ReadStatus.STATUS_SETTING_ERROR);   
        readStatus.setMessage("No sheet definition found");
      }else{
        //Only first ExcelSheet Definition will be used
        ExcelSheet sheetDefinition = definition.getExcelSheets().iterator().next();
       
        Map<String,List<Object>> cacheMap = new HashMap<String, List<Object>>();
        for(String key: beans.keySet()){
          if(beans.get(key) != null)
            cacheMap.put(key, new ArrayList<Object>());
View Full Code Here

Examples of loxia.support.excel.definition.ExcelSheet

 
  private static ExcelManipulatorDefinition generateDefinition(TableModel tableModel){
    ExcelManipulatorDefinition definition = new ExcelManipulatorDefinition();
    definition.setStyleSheetPosition(1);
    List<ExcelSheet> excelSheets = new ArrayList<ExcelSheet>();
    ExcelSheet excelSheet = new ExcelSheet();
    excelSheet.setDisplayName(tableModel.getModelName());
    //add Head Block
    ExcelBlock headBlock = new ExcelBlock();
   
    headBlock.setStartRow(0);
    headBlock.setStartCol(0);
    headBlock.setEndRow(1);
    headBlock.setEndCol(tableModel.getColumnNames().length);
   
    ExcelCell titleCell = new ExcelCell();
    titleCell.setCellIndex("C1");
    titleCell.setDataName("title");   
    setDefaultStyle(titleCell, TITLE_CELL_INDEX);   
    headBlock.addCell(titleCell);
    for(int i=0; i< tableModel.getColumnNames().length; i++){
      ExcelCell labelCell = new ExcelCell();
      labelCell.setRow(1);
      labelCell.setCol(i+1);
      labelCell.setDataName("__column" + (i+1));
      setDefaultStyle(labelCell, LABEL_CELL_INDEX);
      headBlock.addCell(labelCell);
    }
   
    excelSheet.addExcelBlock(headBlock);
   
    //add Body Block
    ExcelBlock bodyBlock = new ExcelBlock();
    bodyBlock.setStartRow(2);
    bodyBlock.setStartCol(1);
    bodyBlock.setEndRow(2);
    bodyBlock.setEndCol(tableModel.getColumnNames().length);
    bodyBlock.setLoop(true);
    bodyBlock.setDataName("__columns");
    for(int i=0; i< tableModel.getColumnNames().length; i++){
      ExcelCell cell = new ExcelCell();
      cell.setRow(2);
      cell.setCol(i+1);
      cell.setDataName(tableModel.getColumns()[i]);
      setDefaultStyle(cell);
      bodyBlock.addCell(cell);
    }
   
    excelSheet.addExcelBlock(bodyBlock);
   
    excelSheets.add(excelSheet);
    definition.setExcelSheets(excelSheets);
    return definition;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.