Package org.apache.poi.xssf.usermodel

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


public class CreateUserDefinedDataFormats {


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


* Working with borders
*/
public class WorkingWithBorders {
    public static void main(String[] args) throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = wb.createSheet("new sheet");

        // Create a row and put some cells in it. Rows are 0 based.
        Row row = sheet.createRow((short) 1);

        // Create a cell and put a value in it.
View Full Code Here

* Working with Fonts
*/
public class WorkingWithFonts {
    public static void main(String[] args) throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = wb.createSheet("new sheet");

        // Create a row and put some cells in it. Rows are 0 based.
        Row row = sheet.createRow((short) 1);

        // Create a new font and alter it.
View Full Code Here

* Merging cells
*/
public class MergingCells {
    public static void main(String[] args) throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = wb.createSheet("new sheet");

        Row row = sheet.createRow((short) 1);
        Cell cell = row.createCell((short) 1);
        cell.setCellValue(new XSSFRichTextString("This is a test of merging"));

View Full Code Here

        private File createFile() throws IOException, FileNotFoundException {
            final Workbook wb = new XSSFWorkbook();
            String sheetName = model.getName();
            final File tempFile = File.createTempFile(ExcelFileModel.class.getCanonicalName(), sheetName + ".xlsx");
            final FileOutputStream fos = new FileOutputStream(tempFile);
            final Sheet sheet = wb.createSheet(sheetName);
           
            final ObjectSpecification typeOfSpec = model.getTypeOfSpecification();
            @SuppressWarnings("unchecked")
            final Filter<ObjectAssociation> filter = Filters.and(
                    ObjectAssociationFilters.PROPERTIES,
View Full Code Here

public class ScatterChart {

  public static void main(String[]args) throws Exception {
    Workbook wb = new XSSFWorkbook();
    CreationHelper creationHelper = wb.getCreationHelper();
    Sheet sheet = wb.createSheet("Sheet 1");
    final int NUM_OF_ROWS = 3;
    final int NUM_OF_COLUMNS = 10;

    // Create a row and put some cells in it. Rows are 0 based.
    Row row;
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 = new SXSSFWorkbook(xssfWorkbook);
      assertEquals(1, wb.getNumberOfSheets());
      Sheet sheet  = wb.getSheetAt(0);
View Full Code Here

      assertEquals("S1", sheet.getSheetName());
    }
   
    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

    }
   
    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);
      xssfWorkbook = (XSSFWorkbook) SXSSFITestDataProvider.instance.writeOutAndReadBack(wb);
View Full Code Here

        private File createFile() throws IOException, FileNotFoundException {
            final Workbook wb = new XSSFWorkbook();
            String sheetName = model.getName();
            final File tempFile = File.createTempFile("/tmp", sheetName + ".xlsx");
            final FileOutputStream fos = new FileOutputStream(tempFile);
            final Sheet sheet = wb.createSheet(sheetName);
           
            final ObjectSpecification typeOfSpec = model.getTypeOfSpecification();
            @SuppressWarnings("unchecked")
            final Filter<ObjectAssociation> filter = Filters.and(
                    ObjectAssociationFilters.PROPERTIES,
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.