导出去html标签

This commit is contained in:
yuezhihang
2022-01-19 16:47:43 +08:00
parent 07ce4f1866
commit 4821c6c34b
3 changed files with 110 additions and 4 deletions
@@ -1,5 +1,6 @@
package com.adc.da.common;
import com.adc.da.utils.removeHtml.RemoveHtml;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.ss.usermodel.*;
@@ -93,6 +94,10 @@ public class TableToExcel {
if (!"commentText".equals(key)) {
try {
Object val = BeanUtils.getProperty(t, key);
val= RemoveHtml.getResultsFromHtml(String.valueOf(val));
if ("null".equals(val)){
val="";
}
if (val instanceof Long) {
dataRow.createCell(v++).setCellValue((Long) val);
} else if (val instanceof Double) {