public class ExcelWorkbook extends Object
ExcelWorkbook.newBook().newSheet("Countries").newRow() // HEADER
.newCell("Country").header().newCell("Population 2018").header().newCell("Percentage").header() //
.newRow() // FIRST ROW
.newCell("Belgium").newCell(11_000_000L).numericFormat()//
.newCell(BigDecimal.valueOf(11_000_000d / 72_000_000d)).percentFormat() //
.newRow() // SECOND ROW
.newCell("UK").newCell(62_000_000L).numericFormat() //
.newCell(BigDecimal.valueOf(62_000_000d / 72_000_000d)).percentFormat() //
.newRow() // TOTAL
.newCell("Total").bold().newCell(72_000_000L).numericFormat().bold() //
.autoSizeColumn(0, 1) //
.save("test.xlsx"); // Save it
Constructor and Description |
---|
ExcelWorkbook(boolean streaming) |
Modifier and Type | Method and Description |
---|---|
org.apache.poi.ss.usermodel.CellStyle |
cloneStyle(int styleHashCode) |
org.apache.poi.ss.usermodel.Font |
createFont() |
ExcelWorkbook |
dispose() |
Optional<org.apache.poi.ss.usermodel.CellStyle> |
findStyle(int styleHashCode) |
static ExcelWorkbook |
newInMemoryWorkbook() |
ExcelSheet |
newSheet(String name) |
static ExcelWorkbook |
newStreamingWorkbook() |
org.apache.poi.ss.usermodel.Workbook |
poiWorkbook() |
ExcelWorkbook |
save(String fileName) |
public static ExcelWorkbook newStreamingWorkbook()
public static ExcelWorkbook newInMemoryWorkbook()
public ExcelSheet newSheet(String name)
public org.apache.poi.ss.usermodel.Workbook poiWorkbook()
public ExcelWorkbook dispose()
public ExcelWorkbook save(String fileName) throws IOException
IOException
public org.apache.poi.ss.usermodel.Font createFont()
public Optional<org.apache.poi.ss.usermodel.CellStyle> findStyle(int styleHashCode)
public org.apache.poi.ss.usermodel.CellStyle cloneStyle(int styleHashCode)
Copyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.