Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.Workbook.createSheet()


            throw new IOException(MessageFormat.format(
                    "Failed to create an output directory for {0}",
                    output));
        }
        final Workbook workbook = Util.createEmptyWorkbookFor(output.getPath());
        Sheet sheet = workbook.createSheet("results");
        return new ExcelSheetSink(definition, sheet, version.getMaxColumns()) {
            private boolean closed = false;
            @Override
            public void close() throws IOException {
                if (closed) {
View Full Code Here


     
    Workbook workbook = new HSSFWorkbook();
     
    for (int cnt=0; cnt<tests.size(); cnt++) {
      setColumns(tests.get(cnt));
      Sheet sheet = workbook.createSheet("Test " + cnt);
      Row row = sheet.createRow(0);

      int counter = 2; //A counter which is used to determine how many additional columns are needed.
      createCell(workbook, row, 0, "Grupa", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
      createCell(workbook, row, 1, "Indeks", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
View Full Code Here

        ExcelParser parser = new ExcelParser((Map<String, List<DataListener>>) null);

        CellRangeAddress[] ranges = new CellRangeAddress[1];

        Workbook workbook = new XSSFWorkbook();
        Sheet sheet = workbook.createSheet();
        Cell cell = sheet.createRow(2).createCell(2);
        ranges[0] = new CellRangeAddress(2, 7, 2, 5);
        cell.setCellValue(FIRST_CELL_CONTENT);

        cell = sheet.createRow(7).createCell(5);
View Full Code Here

    patriarch = null;

    Workbook workbook = getWorkbook();
    if (sheetName == null)
    {
      return workbook.createSheet();
    }
    else
    {
      final String uniqueSheetname = makeUnique(sheetName);
      if (uniqueSheetname.length() == 0 || uniqueSheetname.length() > 31)
View Full Code Here

    {
      final String uniqueSheetname = makeUnique(sheetName);
      if (uniqueSheetname.length() == 0 || uniqueSheetname.length() > 31)
      {
        logger.warn("A sheet name must not be empty and greater than 31 characters");
        return workbook.createSheet();
      }
      else if (isValidSheetName(uniqueSheetname) == false)
      {
        logger.warn("A sheet name must not contain any of ':/\\*?[]'");
        // OpenOffice is even more restrictive and only allows Letters,
View Full Code Here

      else if (isValidSheetName(uniqueSheetname) == false)
      {
        logger.warn("A sheet name must not contain any of ':/\\*?[]'");
        // OpenOffice is even more restrictive and only allows Letters,
        // Digits, Spaces and the Underscore
        return workbook.createSheet();
      }
      else
      {
        return workbook.createSheet(uniqueSheetname);
      }
View Full Code Here

        // Digits, Spaces and the Underscore
        return workbook.createSheet();
      }
      else
      {
        return workbook.createSheet(uniqueSheetname);
      }
    }
  }

  protected void configureSheetProperties(final Sheet sheet, final SheetPropertySource excelTableContentProducer)
View Full Code Here

   */
  public void store()
  {
    Workbook wb = this.newWorkbookToWrite();
    CreationHelper createHelper = wb.getCreationHelper();
    Sheet sheet = wb.createSheet( "all" );
   
    int lineNumber = 0;
    for ( TableRow iLine : this.tableRowList )
    {
      //
View Full Code Here

                sheetName = "Dates";
            }
        } else {
            sheetName = "Times";
        }
        Sheet sheet = workbook.createSheet(sheetName);
        Row header = sheet.createRow(0);
        header.createCell(0).setCellValue("locale");
        header.createCell(1).setCellValue("DisplayName");
        header.createCell(2).setCellValue("Excel " + styleName);
        header.createCell(3).setCellValue("java.text.DateFormat");
View Full Code Here

        d1Percent.setDataFormat(format.getFormat("0.0%"));
        // x.xx%
        CellStyle d2Percent = wb.createCellStyle();
        d2Percent.setDataFormat(format.getFormat("0.00%"));
       
        Sheet s = wb.createSheet();
        Row r1 = s.createRow(0);
       
        for (int i=0; i<3; i++) {
            r1.createCell(i, Cell.CELL_TYPE_NUMERIC).setCellValue(0);
        }
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.