public class ExcelWrite extends Object
| 构造器和说明 |
|---|
ExcelWrite() |
| 限定符和类型 | 方法和说明 |
|---|---|
private void |
excelWriterWithTemplate(Object headData,
Object contentData,
MergeStrategy mergeStrategy,
com.alibaba.excel.write.style.HorizontalCellStyleStrategy horizontalCellStyleStrategy,
String outFileName,
String templateFileName,
boolean hasWeb,
javax.servlet.http.HttpServletResponse response,
InputStream inputStream) |
private String |
formatFileName(String filename) |
private <X,Y> ByteArrayInputStream |
getByteArrayInputStream(ExcelData<X,Y> excelData,
org.apache.poi.xssf.usermodel.XSSFWorkbook xssfWorkbook) |
private com.alibaba.excel.write.style.HorizontalCellStyleStrategy |
getDefaultHorizontalCellStyleStrategy(ExcelStyle style) |
private javax.servlet.http.HttpServletResponse |
setResponse(String outFileName,
javax.servlet.http.HttpServletResponse response) |
private <X,Y> void |
writeExcelSheet(ExcelData<X,Y> excelData,
com.alibaba.excel.ExcelWriter excelWriter) |
void |
writeWithTemplate(Object headData,
Object contentData,
MergeStrategy mergeStrategy,
com.alibaba.excel.write.style.HorizontalCellStyleStrategy horizontalCellStyleStrategy,
String outFileName,
String templateFileName)
Use the template output excel, you can customize the merging rules and content display style.
|
void |
writeWithTemplateByWeb(Object headData,
Object contentData,
MergeStrategy mergeStrategy,
com.alibaba.excel.write.style.HorizontalCellStyleStrategy horizontalCellStyleStrategy,
String outFileName,
String templateFileName,
javax.servlet.http.HttpServletResponse response)
Use the template output excel by web, you can customize the merging rules and content display style.
|
<X,Y> void |
writeWithTemplateMultiSheet(ExcelData<X,Y> excelData,
String outFileName,
String templateFileName)
Use templates to write multi-sheet files: containing table headers, multiple rows of content.
|
<X,Y> void |
writeWithTemplateMultiSheetByWeb(ExcelData<X,Y> excelData,
String outFileName,
String templateFileName,
javax.servlet.http.HttpServletResponse response)
Use templates to write multi-sheet files by web: containing table headers, multiple rows of content.
|
public void writeWithTemplateByWeb(Object headData, Object contentData, MergeStrategy mergeStrategy, com.alibaba.excel.write.style.HorizontalCellStyleStrategy horizontalCellStyleStrategy, String outFileName, String templateFileName, javax.servlet.http.HttpServletResponse response) throws IOException
headData - Excel header sectioncontentData - Excel content sectionmergeStrategy - Merge styleshorizontalCellStyleStrategy - Content stylesoutFileName - Output file nametemplateFileName - Template file nameresponse - responseIOExceptionpublic void writeWithTemplate(Object headData, Object contentData, MergeStrategy mergeStrategy, com.alibaba.excel.write.style.HorizontalCellStyleStrategy horizontalCellStyleStrategy, String outFileName, String templateFileName) throws IOException
headData - Excel header sectioncontentData - Excel content sectionmergeStrategy - Merge styleshorizontalCellStyleStrategy - Content stylesoutFileName - Output file nametemplateFileName - Template file nameIOExceptionpublic <X,Y> void writeWithTemplateMultiSheetByWeb(ExcelData<X,Y> excelData, String outFileName, String templateFileName, javax.servlet.http.HttpServletResponse response) throws IOException
X - Sheet header data typeY - Sheet body data typeexcelData - Sheet header, sheet content, sheet nameoutFileName - File nametemplateFileName - Template file nameresponse - HttpServletResponseIOExceptionpublic <X,Y> void writeWithTemplateMultiSheet(ExcelData<X,Y> excelData, String outFileName, String templateFileName) throws IOException
X - Sheet header data typeY - Sheet body data typeexcelData - Sheet header, sheet content, sheet nameoutFileName - File name ,full path. example: /home/out.xlsxtemplateFileName - Template name, full path. example: /home/template.xlsxIOExceptionprivate <X,Y> ByteArrayInputStream getByteArrayInputStream(ExcelData<X,Y> excelData, org.apache.poi.xssf.usermodel.XSSFWorkbook xssfWorkbook) throws IOException
IOExceptionprivate <X,Y> void writeExcelSheet(ExcelData<X,Y> excelData, com.alibaba.excel.ExcelWriter excelWriter)
private javax.servlet.http.HttpServletResponse setResponse(String outFileName, javax.servlet.http.HttpServletResponse response)
private void excelWriterWithTemplate(Object headData, Object contentData, MergeStrategy mergeStrategy, com.alibaba.excel.write.style.HorizontalCellStyleStrategy horizontalCellStyleStrategy, String outFileName, String templateFileName, boolean hasWeb, javax.servlet.http.HttpServletResponse response, InputStream inputStream) throws IOException
IOExceptionprivate com.alibaba.excel.write.style.HorizontalCellStyleStrategy getDefaultHorizontalCellStyleStrategy(ExcelStyle style)
Copyright © 2021. All rights reserved.