Package org.apache.poi.xssf.usermodel

Examples of org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet()


    }


    private void groupRowColumn() throws Exception{
  Workbook wb = new XSSFWorkbook();
  Sheet sheet1 = wb.createSheet("new sheet");

  sheet1.groupRow( 5, 14 );
  sheet1.groupRow( 7, 14 );
  sheet1.groupRow( 16, 19 );
View Full Code Here


    }

    private void collapseExpandRowColumn()throws Exception{
  Workbook wb2 = new XSSFWorkbook();
  Sheet sheet2 = wb2.createSheet("new sheet");
  sheet2.groupRow( 5, 14 );
  sheet2.groupRow( 7, 14 );
  sheet2.groupRow( 16, 19 );

  sheet2.groupColumn( (short)4, (short)7 );
View Full Code Here

*/
public class ShiftRows {

    public static void main(String[]args) throws Exception {
        Workbook wb = new XSSFWorkbook();   //or new HSSFWorkbook();
        Sheet sheet = wb.createSheet("Sheet1");

        Row row1 = sheet.createRow(1);
        row1.createCell(0).setCellValue(1);

        Row row2 = sheet.createRow(4);
View Full Code Here

         * The second and third parameters specify the range for the columns to repreat.
         * To stop the columns from repeating pass in -1 as the start and end column.
         * The fourth and fifth parameters specify the range for the rows to repeat.
         * To stop the columns from repeating pass in -1 as the start and end rows.
         */
        Sheet sheet1 = wb.createSheet("new sheet");
        Sheet sheet2 = wb.createSheet("second sheet");

        // Set the columns to repeat from column 0 to 2 on the first sheet
        Row row1 = sheet1.createRow(0);
        row1.createCell(0).setCellValue(1);
View Full Code Here

         * To stop the columns from repeating pass in -1 as the start and end column.
         * The fourth and fifth parameters specify the range for the rows to repeat.
         * To stop the columns from repeating pass in -1 as the start and end rows.
         */
        Sheet sheet1 = wb.createSheet("new sheet");
        Sheet sheet2 = wb.createSheet("second sheet");

        // Set the columns to repeat from column 0 to 2 on the first sheet
        Row row1 = sheet1.createRow(0);
        row1.createCell(0).setCellValue(1);
        row1.createCell(1).setCellValue(2);
View Full Code Here

public class WorkbookProperties {

    public static void main(String[]args) throws Exception {

        XSSFWorkbook workbook = new XSSFWorkbook();
        workbook.createSheet("Workbook Properties");

        POIXMLProperties props = workbook.getProperties();

        /**
         * Extended properties are a predefined set of metadata properties
View Full Code Here

public class CreateUserDefinedDataFormats {


    public static void main(String[]args) throws Exception {
        Workbook wb = new XSSFWorkbook()//or new HSSFWorkbook();
        Sheet sheet = wb.createSheet("format sheet");
        CellStyle style;
        DataFormat format = wb.createDataFormat();
        Row row;
        Cell cell;
        short rowNum = 0;
View Full Code Here

    }

    public void testEncodingbeloAscii(){
        Workbook xwb = new XSSFWorkbook();
        Cell xCell = xwb.createSheet().createRow(0).createCell(0);

        Workbook swb = SXSSFITestDataProvider.instance.createWorkbook();
        Cell sCell = swb.createSheet().createRow(0).createCell(0);

        StringBuffer sb = new StringBuffer();
View Full Code Here

        }
    }

    public void testExistingWorkbook() {
      XSSFWorkbook xssfWorkbook = new XSSFWorkbook();
      xssfWorkbook.createSheet("S1");
      SXSSFWorkbook wb = new SXSSFWorkbook(xssfWorkbook);
      xssfWorkbook = (XSSFWorkbook) SXSSFITestDataProvider.instance.writeOutAndReadBack(wb);
      wb.dispose();

        wb = new SXSSFWorkbook(xssfWorkbook);
View Full Code Here

    }

    public void testAddToExistingWorkbook() {
      XSSFWorkbook xssfWorkbook = new XSSFWorkbook();
      xssfWorkbook.createSheet("S1");
      Sheet sheet = xssfWorkbook.createSheet("S2");
      Row row = sheet.createRow(1);
      Cell cell = row.createCell(1);
      cell.setCellValue("value 2_1_1");
      SXSSFWorkbook wb = new SXSSFWorkbook(xssfWorkbook);
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.