Commit 6d9665a9 authored by Eddie.Wu's avatar Eddie.Wu

Merge branch 'dev_wzk_period1' into 'dev_mysql'

生成税金计算表时根据税金项目的长度动态设置行高

See merge request root/atms!444
parents 50c786df cbcf1dfe
...@@ -913,6 +913,16 @@ public class ReportServiceImpl extends BaseService { ...@@ -913,6 +913,16 @@ public class ReportServiceImpl extends BaseService {
sumMap.get(TaxesCalculateReportEnum.Column.Column_11.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_11.getIndex() + 1, "") + rowIndex); sumMap.get(TaxesCalculateReportEnum.Column.Column_11.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_11.getIndex() + 1, "") + rowIndex);
} }
//根据税金项目的长度动态设置行高,不能放在上面那个循环里面,否则只会改变第一行高度
for(int i = 1; i< rowIndex; i++){
Row rowTemp = sheet.getRow(i);
//首先计算税金项目的字节宽度和单元格本身高度做除法计算比较大小,超出单元格宽度则要加大高度
int configNameWidth = dataList.get(rowIndex-i-1).getName().getBytes().length * 256;
int columnWidth = sheet.getColumnWidth(rowTemp.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).getColumnIndex());
rowTemp.setHeight((short) (rowTemp.getHeight()*(configNameWidth/columnWidth+1)));
}
//组装合计项数据 //组装合计项数据
assembleSumRow(sheet.getRow(rowIndex), sumMap); assembleSumRow(sheet.getRow(rowIndex), sumMap);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment