Examples of createCellStyle()


Examples of org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle()

        lhs.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
       
        HSSFCellStyle tar = wb.createCellStyle();
        tar.setAlignment(HSSFCellStyle.ALIGN_CENTER);
       
        HSSFCellStyle rhs = wb.createCellStyle();
        rhs.setAlignment(HSSFCellStyle.ALIGN_LEFT);
       
        int ii;
        row = sheet.createRow((short)0); // blank line
        cell = row.createCell((short)0);
View Full Code Here

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

     *
     * @return
     */
    public CellStyle createCellStyle() {
        Workbook workbook = getWorkbook(true);
        return workbook.createCellStyle();
    }

    public Font createFont() {
        Workbook workbook = getWorkbook(true);
        return workbook.createFont();
View Full Code Here

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

        // How close the sizing should be, given that not all
        //  systems will have quite the same fonts on them
        float fontAccuracy = 0.22f;
       
        // x%
        CellStyle iPercent = wb.createCellStyle();
        iPercent.setDataFormat(format.getFormat("0%"));
        // x.x%
        CellStyle d1Percent = wb.createCellStyle();
        d1Percent.setDataFormat(format.getFormat("0.0%"));
        // x.xx%
View Full Code Here

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

       
        // x%
        CellStyle iPercent = wb.createCellStyle();
        iPercent.setDataFormat(format.getFormat("0%"));
        // x.x%
        CellStyle d1Percent = wb.createCellStyle();
        d1Percent.setDataFormat(format.getFormat("0.0%"));
        // x.xx%
        CellStyle d2Percent = wb.createCellStyle();
        d2Percent.setDataFormat(format.getFormat("0.00%"));
       
View Full Code Here

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

        iPercent.setDataFormat(format.getFormat("0%"));
        // x.x%
        CellStyle d1Percent = wb.createCellStyle();
        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);
       
View Full Code Here

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

        // declare a row object reference
        Row r = null;
        // declare a cell object reference
        Cell c = null;
        // create 3 cell styles
        CellStyle cs = wb.createCellStyle();
        CellStyle cs2 = wb.createCellStyle();
        CellStyle cs3 = wb.createCellStyle();
        DataFormat df = wb.createDataFormat();
        // create 2 fonts objects
        Font f = wb.createFont();
View Full Code Here

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

        Row r = null;
        // declare a cell object reference
        Cell c = null;
        // create 3 cell styles
        CellStyle cs = wb.createCellStyle();
        CellStyle cs2 = wb.createCellStyle();
        CellStyle cs3 = wb.createCellStyle();
        DataFormat df = wb.createDataFormat();
        // create 2 fonts objects
        Font f = wb.createFont();
        Font f2 = wb.createFont();
View Full Code Here

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

        // declare a cell object reference
        Cell c = null;
        // create 3 cell styles
        CellStyle cs = wb.createCellStyle();
        CellStyle cs2 = wb.createCellStyle();
        CellStyle cs3 = wb.createCellStyle();
        DataFormat df = wb.createDataFormat();
        // create 2 fonts objects
        Font f = wb.createFont();
        Font f2 = wb.createFont();
View Full Code Here

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

        //formula
        row.createCell(5).setCellFormula("SUM(A1:B1)");

        //date
        CellStyle style = wb.createCellStyle();
        style.setDataFormat(creationHelper.createDataFormat().getFormat("m/d/yy h:mm"));
        cell = row.createCell(6);
        cell.setCellValue(new Date());
        cell.setCellStyle(style);
View Full Code Here

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

        // Create a cell and put a value in it.
        Cell cell = row.createCell((short) 1);
        cell.setCellValue(4);

        // Style the cell with borders all around.
        CellStyle style = wb.createCellStyle();
        style.setBorderBottom(CellStyle.BORDER_THIN);
        style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
        style.setBorderLeft(CellStyle.BORDER_THIN);
        style.setLeftBorderColor(IndexedColors.GREEN.getIndex());
        style.setBorderRight(CellStyle.BORDER_THIN);
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.