1. 程式人生 > >jeesite匯出Excel Minimum column number is 0

jeesite匯出Excel Minimum column number is 0

問題 今天在用jeesite(poi)做匯出的時候遇到一些問題!記錄一下.
java.lang.IllegalArgumentException: Minimum column number is 0
at org.apache.poi.ss.util.CellRangeAddressBase.validateColumn(CellRangeAddressBase.java:73)
at org.apache.poi.ss.util.CellRangeAddressBase.validate(CellRangeAddressBase.java:54)
at org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegion(XSSFSheet.java:270)
at org.apache.poi.xssf.streaming.SXSSFSheet.addMergedRegion(SXSSFSheet.java:342)
at com.sdfyzx.common.utils.excel.ExportExcel.initialize(ExportExcel.java:200)
at com.sdfyzx.common.utils.excel.ExportExcel.(ExportExcel.java:163)
at com.sdfyzx.common.utils.excel.ExportExcel.(ExportExcel.java:84)
at com.sdfyzx.modules.echarts.web.EchartsController.exportFile(EchartsController.java:320)
at com.sdfyzx.modules.echarts.web.EchartsController$$FastClassBySpringCGLIB$$887abd62.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:640)


原因是沒有加註解 @ExcelField(title="所屬區域", align=2, sort=10,dictType="xx") 1、title匯出欄位標題,String 2align匯出欄位對齊方式(0:自動;1:靠左;2:居中;3:靠右), int  3sort匯出欄位欄位排序(升序), int 4dictType如果是字典型別,請設定字典的type值 , String