public class ExcelExporter extends AbstractExcelExporter<java.lang.Boolean>
AbstractExcelExporter.FontAdapter, AbstractExcelExporter.JavaFontAdapter, AbstractExcelExporter.TextFontAdapter
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
isExcel2003 |
A3_PAGE_SIZE, A6_PAGE_SIZE, B4_PAGE_SIZE, B5_PAGE_SIZE, colorList, columnRowPostileMaps, DEFAULT_COL_WIDTH, DEFAULT_FONT, DEFAULT_SCALE, EIGHTH, ex_tool, EXCEL_EXPORT_RESOLUTION, FONT_SCALE, FORMULA_ERROR, HANDRED, HEIGHT_LIMIT, hssfCellStyleHash, hssfFontHash, LEDGER_PAGE_SIZE, MAX_PROPER_FONT, NOTE_PAGE_SIZE, paperSettingList, PICTURE_TYPE_PNG, ROTATION_DOWN, ROTATION_UPPER, sheets2Export, totalBreak
构造器和说明 |
---|
ExcelExporter()
创建一个ExcelExporter
|
ExcelExporter(java.util.List paperSettingList)
创建一个ExcelExporter
|
限定符和类型 | 方法和说明 |
---|---|
protected boolean |
checkExcelExportVersion() |
protected POIFontAction |
createFont(POIWorkbookAction wbWrapper,
java.awt.Font font) |
protected void |
dealECReportAndBlockPageSetting(ElementCase report,
com.fr.third.org.apache.poi.hssf.usermodel.HSSFSheet hssfSheet,
int reportIndex) |
protected void |
dealWithPageSetting(Report report,
com.fr.third.org.apache.poi.hssf.usermodel.HSSFSheet hssfSheet,
int reportIndex) |
void |
export(java.io.OutputStream out,
ResultWorkBook book)
导出Workbook
分页报表导出excel例子:
WorkBook workbook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(FRContext.getCommonOperator(), "1.cpt");
PageRWorkBook book = (PageRWorkBook) workbook.execute(new HashMap(), ActorFactory.getActor("page"));
OutputStream os = new FileOutputStream(new File("c:/a.xls"));
new ExcelExporter().export(out, book);
|
void |
export(java.io.OutputStream out,
ResultWorkBook book,
boolean reUse)
导出Workbook
|
void |
export(java.io.OutputStream out,
ResultWorkBook book,
boolean reUse,
int[] sheets)
导出Workbook
填报模板只导出第一个sheet和第二个sheet的例子:
WorkBook workbook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(FRContext.getCommonOperator(), "1.cpt");
WriteRWorkBook book = (WriteRWorkBook) workbook.execute(new HashMap(), ActorFactory.getActor("write"));
OutputStream out = new FileOutputStream(new File("c:/a.xls"));
new ExcelExporter().export(out, book, false, new int[] {0, 1});
|
void |
export(java.io.OutputStream out,
ResultWorkBook workBook,
PageSetCreator pageSet,
ReportRepositoryDeal repo,
int[] sheets)
导出
|
protected void |
exportFor2003(java.io.OutputStream out,
ResultWorkBook book,
boolean reUse) |
protected void |
exportFor2007(java.io.OutputStream out,
ResultWorkBook book) |
protected AppExporter |
getExporterFor2007(java.util.List<PaperSettingProvider> paperSettingList)
获取当前类对应的excel 2007导出类
|
protected int |
getFloatLeftMax(double columnWidth) |
protected int |
getFloatTopMax(double rowHeight) |
protected short |
getFormat(POIWorkbookAction wb,
java.lang.String pattern) |
protected short |
getRotation(Style style) |
protected POIRichStringAction<com.fr.third.org.apache.poi.hssf.usermodel.HSSFRichTextString> |
initRichString(java.lang.String content) |
protected void |
innerExportReport(Report report,
ReportExportAttr exportAttr,
java.lang.String sheetName,
com.fr.third.org.apache.poi.hssf.usermodel.HSSFWorkbook wb,
java.util.List hssfCellList,
java.util.List<java.lang.String> hssfCellFormulaList,
int reportIndex)
Export report,报表不需要再次Execute.
|
protected void |
innerExportReports(ResultECReport innerReport,
ResultWorkBook book,
POIWorkbookAction hssfWorkbook,
java.util.List hssfCellList,
java.util.List<java.lang.String> hssfCellFormulaList,
java.util.List<Report> reportList,
int index) |
boolean |
isExcel2003()
待说明
|
void |
setVersion(java.lang.Boolean isExcel2003)
设置额外的版本
|
adjustProperFontSize, applyReportHFFooter, applyReportHFHeader, checkInvalidFormula, checkNumberFormat, checkValueVertical, createComplexFont4FR, createSimpleFont, dealWithAlignAndMargin, dealWithBufferImage, dealWithFormula, dealWithHiddenCR, dealWithPrintSetUp, dealWithSumFormula, evalCellValue, evalFormulaValue, evalHtmlContent, executeCellStyle, exportBook, exportBook, getMapBorder, getPassword, html2HSSFRichTextString, isShowAsImage, loadPicture, locateFloatElementInExcel, replaceNewLineChar, setAttr4ECReportSIL, setColumnRowBreak, setDefaultFont, setPostilMap, setSheetName, setSheets2Export
export, export
public ExcelExporter()
public ExcelExporter(java.util.List paperSettingList)
paperSettingList
- 各个sheet的页面设置的组成的Listpublic boolean isExcel2003()
public void setVersion(java.lang.Boolean isExcel2003)
AppExporter
setVersion
在接口中 AppExporter<java.lang.Boolean>
setVersion
在类中 AbstractAppExporter<java.lang.Boolean>
isExcel2003
- 版本public void export(java.io.OutputStream out, ResultWorkBook workBook, PageSetCreator pageSet, ReportRepositoryDeal repo, int[] sheets) throws java.lang.Exception
AppExporter
export
在接口中 AppExporter<java.lang.Boolean>
export
在类中 AbstractAppExporter<java.lang.Boolean>
out
- 输出流workBook
- 结果报表pageSet
- 分页集合repo
- 浏览器相关sheets
- sheet索引集合java.lang.Exception
- 导出失败则抛出此异常public void export(java.io.OutputStream out, ResultWorkBook book) throws java.lang.Exception
export
在接口中 AppExporter<java.lang.Boolean>
export
在类中 AbstractExcelExporter<java.lang.Boolean>
out
- 输出流book
- 需要导出的Workbookjava.lang.Exception
- 导出失败则抛出此异常protected AppExporter getExporterFor2007(java.util.List<PaperSettingProvider> paperSettingList) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void export(java.io.OutputStream out, ResultWorkBook book, boolean reUse) throws java.lang.Exception
out
- 输出流book
- 需要导出的WorkbookreUse
- 是否需要缓存java.lang.Exception
public void export(java.io.OutputStream out, ResultWorkBook book, boolean reUse, int[] sheets) throws java.lang.Exception
out
- 输出流book
- 需要导出的WorkbookreUse
- 是否需要缓存sheets
- 需要导出的sheet序号java.lang.Exception
protected void exportFor2007(java.io.OutputStream out, ResultWorkBook book) throws java.lang.Exception
java.lang.Exception
protected void exportFor2003(java.io.OutputStream out, ResultWorkBook book, boolean reUse) throws java.lang.Exception
java.lang.Exception
protected boolean checkExcelExportVersion()
protected void innerExportReports(ResultECReport innerReport, ResultWorkBook book, POIWorkbookAction hssfWorkbook, java.util.List hssfCellList, java.util.List<java.lang.String> hssfCellFormulaList, java.util.List<Report> reportList, int index)
innerExportReports
在类中 AbstractExcelExporter<java.lang.Boolean>
protected void innerExportReport(Report report, ReportExportAttr exportAttr, java.lang.String sheetName, com.fr.third.org.apache.poi.hssf.usermodel.HSSFWorkbook wb, java.util.List hssfCellList, java.util.List<java.lang.String> hssfCellFormulaList, int reportIndex) throws java.lang.Exception
report
- 需要导出的报表exportAttr
- 报表导出属性sheetName
- 当前sheet的名称wb
- poi处理excel的WorkbookhssfCellList
- poi处理excel格子的ListhssfCellFormulaList
- poi处理excel中公式的ListreportIndex
- 当前报表的Indexjava.lang.Exception
protected void dealECReportAndBlockPageSetting(ElementCase report, com.fr.third.org.apache.poi.hssf.usermodel.HSSFSheet hssfSheet, int reportIndex)
protected void dealWithPageSetting(Report report, com.fr.third.org.apache.poi.hssf.usermodel.HSSFSheet hssfSheet, int reportIndex)
protected int getFloatLeftMax(double columnWidth)
getFloatLeftMax
在类中 AbstractExcelExporter<java.lang.Boolean>
protected int getFloatTopMax(double rowHeight)
getFloatTopMax
在类中 AbstractExcelExporter<java.lang.Boolean>
protected short getRotation(Style style)
getRotation
在类中 AbstractExcelExporter<java.lang.Boolean>
protected POIFontAction createFont(POIWorkbookAction wbWrapper, java.awt.Font font)
createFont
在类中 AbstractExcelExporter<java.lang.Boolean>
protected short getFormat(POIWorkbookAction wb, java.lang.String pattern)
getFormat
在类中 AbstractExcelExporter<java.lang.Boolean>
protected POIRichStringAction<com.fr.third.org.apache.poi.hssf.usermodel.HSSFRichTextString> initRichString(java.lang.String content)
initRichString
在类中 AbstractExcelExporter<java.lang.Boolean>