public class Workbook extends Object implements Closeable
| Constructor and Description |
|---|
Workbook(OutputStream os,
String applicationName,
String applicationVersion)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
finish()
Complete workbook generation: this writes worksheets and additional files
as zip entries to the output stream.
|
Worksheet |
newWorksheet(String name)
Create a new worksheet in this workbook.
|
Properties |
properties() |
void |
setActiveTab(int tabIndex) |
void |
setCompressionLevel(int level)
Sets the compression level of the xlsx.
|
void |
setGlobalDefaultFont(org.dhatim.fastexcel.Font font) |
void |
setGlobalDefaultFont(String fontName,
double fontSize) |
void |
sortWorksheets(Comparator<Worksheet> comparator)
Sort the current worksheets with the given Comparator
|
public Workbook(OutputStream os, String applicationName, String applicationVersion)
os - Output stream eventually holding the serialized workbook.applicationName - Name of the application which generated this
workbook.applicationVersion - Version of the application. Ignored if
null. Refer to
this
page for details.public void setCompressionLevel(int level)
level - the compression level (0-9)public void setActiveTab(int tabIndex)
public void setGlobalDefaultFont(String fontName, double fontSize)
public void setGlobalDefaultFont(org.dhatim.fastexcel.Font font)
public Properties properties()
public void sortWorksheets(Comparator<Worksheet> comparator)
comparator - The Comparator used to sort the worksheetspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void finish()
throws IOException
IOException - In case of I/O error.Copyright © 2023. All rights reserved.