Package org.apache.poi.hssf.usermodel

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


    public static void main(String[] args)
        throws IOException
    {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet1 = wb.createSheet("new sheet");
        HSSFSheet sheet2 = wb.createSheet("second sheet");
        FileOutputStream fileOut = new FileOutputStream("workbook.xls");
        wb.write(fileOut);
        fileOut.close();
    }
}
View Full Code Here


{
    public static void main(String[] args)
        throws IOException
    {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("new sheet");
        HSSFRow row = sheet.createRow((short)2);
        row.createCell((short) 0).setCellValue(1.1);
        row.createCell((short) 1).setCellValue(new Date());
        row.createCell((short) 2).setCellValue("a string");
        row.createCell((short) 3).setCellValue(true);
View Full Code Here

{
    public static void main(String[] args)
        throws IOException
    {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet1 = wb.createSheet("new sheet");
        sheet1.setZoom(3,4);   // 75 percent magnification
        FileOutputStream fileOut = new FileOutputStream("workbook.xls");
        wb.write(fileOut);
        fileOut.close();
    }
View Full Code Here

        HSSFWorkbook wb = new HSSFWorkbook();

        HSSFFont font = wb.createFont();
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        HSSFSheet worksheet = wb.createSheet("Customers");
        worksheet.setColumnWidth((short) 0, (short)(20 * 256));
        worksheet.setColumnWidth((short) 1, (short)(30 * 256));
        worksheet.setColumnWidth((short) 4, (short)(20 * 256));

        HSSFRow row = worksheet.createRow((short)0);
View Full Code Here

    }
  }

  private static HSSFWorkbook createWorkbook(UIData table, FacesContext context) {
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet sheet = workbook.createSheet(table.getId());
    List<UIColumn> columns = getColumns(table);
    int currentRowIndex = table.getRowIndex();
    addColumnHeaders(sheet, columns, context);
    addColumnValues(sheet, columns, table, context);
    table.setRowIndex(currentRowIndex);
View Full Code Here

    crit.addOrder(order);
    @SuppressWarnings("unchecked")
    List<Prozess> pl = crit.setFirstResult(0).setMaxResults(Integer.MAX_VALUE).list();

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet("Search results");

    HSSFRow title = sheet.createRow(0);
    HSSFCell titleCell1 = title.createCell(0);
    titleCell1.setCellValue(this.filter);
    HSSFCell titleCell2 = title.createCell(1);
View Full Code Here

  }

  public void testWorksheetReferences() {
    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("NoQuotesNeeded");
    wb.createSheet("Quotes Needed Here &#$@");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;
View Full Code Here

  public void testWorksheetReferences() {
    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("NoQuotesNeeded");
    wb.createSheet("Quotes Needed Here &#$@");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;
View Full Code Here

    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("NoQuotesNeeded");
    wb.createSheet("Quotes Needed Here &#$@");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;

    cell = row.createCell(0);
    cell.setCellFormula("NoQuotesNeeded!A1");
View Full Code Here

  /** bug 35027, underscore in sheet name */
  public void testUnderscore() {
    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("Cash_Flow");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;

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.