Package com.github.javaxcel.out
Interface ExcelWriter<W extends org.apache.poi.ss.usermodel.Workbook,T>
- All Known Implementing Classes:
AbstractExcelWriter,MapWriter,ModelWriter
public interface ExcelWriter<W extends org.apache.poi.ss.usermodel.Workbook,T>
-
Method Summary
Modifier and Type Method Description ExcelWriter<W,T>autoResizeColumns()ExcelWriter<W,T>bodyStyle(com.github.javaxcel.styler.ExcelStyleConfig config)Sets style to body.ExcelWriter<W,T>bodyStyles(com.github.javaxcel.styler.ExcelStyleConfig... configs)Sets styles to body.ExcelWriter<W,T>defaultValue(String defaultValue)Sets default value when value to be written is null or empty.ExcelWriter<W,T>filter()Filters all columns.ExcelWriter<W,T>headerNames(List<String> headerNames)Sets header names.ExcelWriter<W,T>headerStyle(com.github.javaxcel.styler.ExcelStyleConfig config)Sets style to header.ExcelWriter<W,T>headerStyles(com.github.javaxcel.styler.ExcelStyleConfig... configs)Sets styles to header.ExcelWriter<W,T>hideExtraColumns()ExcelWriter<W,T>hideExtraRows()ExcelWriter<W,T>sheetName(String sheetName)Sets sheet name.ExcelWriter<W,T>unrotate()Disables to rotate sheet.voidwrite(OutputStream out, List<T> list)Writes the data in the excel file.
-
Method Details
-
defaultValue
Sets default value when value to be written is null or empty.- Parameters:
defaultValue- replacement of the value when it is null or empty string.- Returns:
ExcelWriter
-
sheetName
Sets sheet name.- Parameters:
sheetName- sheet name- Returns:
ExcelWriter
-
headerNames
Sets header names.- Parameters:
headerNames- header names- Returns:
ExcelWriter
-
unrotate
ExcelWriter<W,T> unrotate()Disables to rotate sheet.If this is invoked, excel file has only one sheet.
- Returns:
ExcelWriter
-
filter
ExcelWriter<W,T> filter()Filters all columns.- Returns:
ExcelWriter
-
headerStyle
Sets style to header.- Parameters:
config- style config- Returns:
ExcelWriter
-
headerStyles
Sets styles to header.- Parameters:
configs- style configs- Returns:
ExcelWriter
-
bodyStyle
Sets style to body.- Parameters:
config- style config- Returns:
ExcelWriter
-
bodyStyles
Sets styles to body.- Parameters:
configs- style configs- Returns:
ExcelWriter
-
autoResizeColumns
ExcelWriter<W,T> autoResizeColumns() -
hideExtraRows
ExcelWriter<W,T> hideExtraRows() -
hideExtraColumns
ExcelWriter<W,T> hideExtraColumns() -
write
Writes the data in the excel file.- Parameters:
out- output stream for writing excel filelist- list of models
-