Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.Sheet.createRow()


        Row newRow = null;
        Cell newCell = null;
        // 2) attempt to create a new row IN PLACE of a removed row by a negative shift causes corrupted
        // xlsx file with  unreadable data in the negative shifted row.
        // NOTE it's ok to create any other row.
        newRow = testSheet.createRow(3);

        saveAndReloadReport(wb, xlsOutput);

        newCell = newRow.createCell(0);
View Full Code Here


             new HSSFWorkbook(),
             new XSSFWorkbook()
       };
       for(Workbook wb : wbs) {
          Sheet s = wb.createSheet();
          Row r = s.createRow(0);
         
          // Setup
          Cell cn = r.createCell(0, Cell.CELL_TYPE_NUMERIC);
          cn.setCellValue(1.2);
          Cell cs = r.createCell(1, Cell.CELL_TYPE_STRING);
View Full Code Here

             new HSSFWorkbook(),
             new XSSFWorkbook()
       };
       for(Workbook wb : wbs) {
          Sheet s = wb.createSheet();
          Row r = s.createRow(0);
         
          // Setup
          Cell cn = r.createCell(0, Cell.CELL_TYPE_NUMERIC);
          cn.setCellValue(1.2);
          Cell cs = r.createCell(1, Cell.CELL_TYPE_STRING);
View Full Code Here

 
    @Override
    protected void exportCells(DataTable table, Object document) {
        Sheet sheet = (Sheet) document;
        int sheetRowIndex = sheet.getLastRowNum() + 1;
        Row row = sheet.createRow(sheetRowIndex);
       
        for (UIColumn col : table.getColumns()) {
            if (col instanceof DynamicColumn) {
                ((DynamicColumn) col).applyStatelessModel();
            }
View Full Code Here

             new HSSFWorkbook(),
             new XSSFWorkbook()
       };
       for(Workbook wb : wbs) {
          Sheet s = wb.createSheet();
          Row r = s.createRow(0);
         
          // Setup
          Cell cn = r.createCell(0, Cell.CELL_TYPE_NUMERIC);
          cn.setCellValue(1.2);
          Cell cs = r.createCell(1, Cell.CELL_TYPE_STRING);
View Full Code Here

    RichTextString rts = workbook.getCreationHelper().createRichTextString("hello world");

    sheet1.createRow(0).createCell((short)0).setCellValue(1.2);
    sheet1.createRow(1).createCell((short)0).setCellValue(rts);
    sheet2.createRow(0);

    assertEquals(0, workbook.getSheetAt(0).getFirstRowNum());
    assertEquals(1, workbook.getSheetAt(0).getLastRowNum());
    assertEquals(0, workbook.getSheetAt(1).getFirstRowNum());
    assertEquals(0, workbook.getSheetAt(1).getLastRowNum());
View Full Code Here

      assertSheetOrder(wb, "Sheet1");
     
      Sheet sheet = wb.getSheetAt(0);
      sheet.shiftRows(2, sheet.getLastRowNum(), 1, true, false);
      Row newRow = sheet.getRow(2);
      if (newRow == null) newRow = sheet.createRow(2);
      newRow.createCell(0).setCellValue(" Another Header");
      wb.cloneSheet(0);

      assertSheetOrder(wb, "Sheet1", "Sheet1 (2)");
View Full Code Here

    Row newRow = null;
    Cell newCell = null;
    // 2) attempt to create a new row IN PLACE of a removed row by a negative shift causes corrupted
    // xlsx file with  unreadable data in the negative shifted row.
    // NOTE it's ok to create any other row.
    newRow = testSheet.createRow(3);

    saveAndReloadReport(wb, xlsOutput);

    newCell = newRow.createCell(0);
View Full Code Here

   
    Row newRow = null; Cell newCell = null;
    // 2) attempt to create a new row IN PLACE of a removed row by a negative shift causes corrupted
    // xlsx file with  unreadable data in the negative shifted row.
    // NOTE it's ok to create any other row.
    newRow = testSheet.createRow(3);
    newCell = newRow.createCell(0);
    newCell.setCellValue("new Cell in row "+newRow.getRowNum());
   
    // 3) once a negative shift has been made any attempt to shift another group of rows
    // (note: outside of previously negative shifted rows) by a POSITIVE amount causes POI exception:
View Full Code Here

    public void testApplyCellForGeneralFormat() {
       
        // Create a workbook, row and cell to test with
        Workbook wb = new HSSFWorkbook();
        Sheet sheet = wb.createSheet();
        Row row = sheet.createRow(0);
        Cell cell0 = row.createCell(0);
        Cell cell1 = row.createCell(1);
        Cell cell2 = row.createCell(2);
        Cell cell3 = row.createCell(3);
        Cell cell4 = row.createCell(4);
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.