public class ExportUtils
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static void |
applyReportHFFooter(ReportHFProvider reportHF,
POIHeaderFooterAction footer)
将报表中的页脚对象设置apply到POI对象中
|
static void |
applyReportHFHeader(ReportHFProvider reportHF,
POIHeaderFooterAction header)
将报表中的页眉对象设置apply到POI对象中
|
static java.lang.Object |
checkExcel2007NumberFormat(java.text.Format cFormat,
java.lang.Object value) |
static java.lang.Object |
checkNumberFormat(java.text.Format cFormat,
java.lang.Object value) |
protected static java.lang.String |
createHFString(java.util.List list)
根据页眉页脚对象列表, 转成字符串形式
|
static void |
dealWithAlignAndMargin(POISheetAction sheet,
ReportSettingsProvider reportSettings,
Margin margin)
设置是否垂直水平居中, 以及边距
|
static void |
dealWithBufferImage(java.lang.Object value,
POIClientAnchorAction clientAnchor,
POIPatriarchAction patriarch,
java.awt.image.BufferedImage buffImg,
POIWorkbookAction wb)
将BufferImage转化成excel中的悬浮元素
|
static void |
dealWithPrintSetUp(POIPrintSetupAction printSetup,
PaperSize paperSize,
int orientation,
ReportSettingsProvider reportSettings)
导出当前报表的打印设置到excel, 包括纸张, 横纵向, 页眉页脚距离
|
static int |
loadPicture(java.awt.image.BufferedImage bufferedImage,
POIWorkbookAction wb) |
static java.lang.String |
replaceNewLineChar(java.lang.String allString)
peter:替换成newline
|
static void |
setCPTContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName) |
static void |
setCSVContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName)
setCSVContext&Header
|
static void |
setExcel2007Content(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName) |
static void |
setExcelContent(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName)
setExcelContext&Header
|
static void |
setHTMLContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName) |
static void |
setImageContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName,
java.lang.String imagetype) |
static void |
setPDFContent(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName,
boolean isEmbbed)
setPDFContent&Header
|
static void |
setSheetName(POIWorkbookAction wb,
java.lang.String name4Sheet)
设置Excelsheet的名字, 同时避免在Workbook中出现重命名现象
限定长度为31个字符
|
static void |
setSVGContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName)
setSVGContext&Header
|
static void |
setTextContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName)
setTextContext
|
static void |
setWordConetent(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName)
setWordContext&Header
|
static void |
setZipContext(javax.servlet.http.HttpServletResponse res,
java.lang.String fileName,
boolean isSetContextTypeOnZipDownload)
setZipContext&Header
|
public static void dealWithBufferImage(java.lang.Object value, POIClientAnchorAction clientAnchor, POIPatriarchAction patriarch, java.awt.image.BufferedImage buffImg, POIWorkbookAction wb)
value
- 当前悬浮元素clientAnchor
- excel中定位元素patriarch
- excel中的悬浮元素buffImg
- 待转化的BufferImagewb
- 当前excel工作表public static void setSheetName(POIWorkbookAction wb, java.lang.String name4Sheet)
wb
- 当前的Excel Bookname4Sheet
- 指定的sheet名public static void dealWithPrintSetUp(POIPrintSetupAction printSetup, PaperSize paperSize, int orientation, ReportSettingsProvider reportSettings)
printSetup
- excel中的打印设置paperSize
- 报表中的纸张设置orientation
- 横纵向显示reportSettings
- 报表页面设置public static void dealWithAlignAndMargin(POISheetAction sheet, ReportSettingsProvider reportSettings, Margin margin)
sheet
- 导出的poisheetreportSettings
- 报表页面设置margin
- 边距public static void applyReportHFHeader(ReportHFProvider reportHF, POIHeaderFooterAction header)
header
- POI中的页眉reportHF
- 报表中的页眉public static void applyReportHFFooter(ReportHFProvider reportHF, POIHeaderFooterAction footer)
footer
- POI中的页脚reportHF
- 报表中的页脚protected static java.lang.String createHFString(java.util.List list)
list
- 页眉页脚对象列表public static java.lang.String replaceNewLineChar(java.lang.String allString)
public static int loadPicture(java.awt.image.BufferedImage bufferedImage, POIWorkbookAction wb) throws java.io.IOException
java.io.IOException
public static java.lang.Object checkNumberFormat(java.text.Format cFormat, java.lang.Object value)
public static java.lang.Object checkExcel2007NumberFormat(java.text.Format cFormat, java.lang.Object value)
public static void setPDFContent(javax.servlet.http.HttpServletResponse res, java.lang.String fileName, boolean isEmbbed)
res
- isEmbbed
- fileName
- public static void setExcelContent(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
res
- fileName
- public static void setExcel2007Content(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
public static void setWordConetent(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
res
- fileName
- public static void setZipContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName, boolean isSetContextTypeOnZipDownload)
res
- fileName
- isSetContextTypeOnZipDownload
- public static void setSVGContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
res
- fileName
- public static void setCSVContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
res
- fileName
- public static void setTextContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
res
- fileName
- public static void setImageContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName, java.lang.String imagetype)
public static void setCPTContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)
public static void setHTMLContext(javax.servlet.http.HttpServletResponse res, java.lang.String fileName)