Search in sources :

Example 21 with HSSFFont

use of org.apache.poi.hssf.usermodel.HSSFFont in project poi by apache.

the class NumberRenderingSpreadsheetGenerator method writeHeaderRow.

static void writeHeaderRow(HSSFWorkbook wb, HSSFSheet sheet) {
    sheet.setColumnWidth(0, 3000);
    sheet.setColumnWidth(1, 6000);
    sheet.setColumnWidth(2, 6000);
    sheet.setColumnWidth(3, 6000);
    sheet.setColumnWidth(4, 6000);
    sheet.setColumnWidth(5, 1600);
    sheet.setColumnWidth(6, 20000);
    HSSFRow row = sheet.createRow(0);
    HSSFCellStyle style = wb.createCellStyle();
    HSSFFont font = wb.createFont();
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    style.setFont(font);
    writeHeaderCell(row, 0, "Value", style);
    writeHeaderCell(row, 1, "Raw Long Bits", style);
    writeHeaderCell(row, 2, "JDK Double Rendering", style);
    writeHeaderCell(row, 3, "Actual Rendering", style);
    writeHeaderCell(row, 4, "Expected Rendering", style);
    writeHeaderCell(row, 5, "Match", style);
    writeHeaderCell(row, 6, "Java Metadata", style);
}
Also used : HSSFCellStyle(org.apache.poi.hssf.usermodel.HSSFCellStyle) HSSFRow(org.apache.poi.hssf.usermodel.HSSFRow) HSSFFont(org.apache.poi.hssf.usermodel.HSSFFont)

Aggregations

HSSFFont (org.apache.poi.hssf.usermodel.HSSFFont)21 HSSFCellStyle (org.apache.poi.hssf.usermodel.HSSFCellStyle)16 HSSFCell (org.apache.poi.hssf.usermodel.HSSFCell)12 HSSFRow (org.apache.poi.hssf.usermodel.HSSFRow)10 HSSFRichTextString (org.apache.poi.hssf.usermodel.HSSFRichTextString)9 HSSFWorkbook (org.apache.poi.hssf.usermodel.HSSFWorkbook)9 HSSFSheet (org.apache.poi.hssf.usermodel.HSSFSheet)8 FileOutputStream (java.io.FileOutputStream)7 HSSFClientAnchor (org.apache.poi.hssf.usermodel.HSSFClientAnchor)2 HSSFPatriarch (org.apache.poi.hssf.usermodel.HSSFPatriarch)2 HSSFColor (org.apache.poi.hssf.util.HSSFColor)2 Region (org.apache.poi.hssf.util.Region)2 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)2 Color (java.awt.Color)1 Font (java.awt.Font)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 DecimalFormat (java.text.DecimalFormat)1 HSSFComment (org.apache.poi.hssf.usermodel.HSSFComment)1