Browse Source

Pull request #5612: REPORT-70032 & REPORT-70020 poi升级适配,富文本流式导出问题

Merge in CORE/base-third from ~ABEL.CHEN/base-third:feature/x to feature/x

* commit 'd23a95ed10916a6a41074a806f91bee4e9643945':
  REPORT-70032 & REPORT-70020 poi升级适配
feature/x
abel.chen 3 years ago
parent
commit
3cf8919229
  1. 2
      fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
  2. 5
      fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/streaming/SheetDataWriter.java

2
fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/streaming/SXSSFWorkbook.java

@ -208,7 +208,7 @@ public class SXSSFWorkbook implements Workbook {
* @param compressTmpFiles whether to use gzip compression for temporary files * @param compressTmpFiles whether to use gzip compression for temporary files
*/ */
public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles){ public SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles){
this(workbook,rowAccessWindowSize, compressTmpFiles, false); this(workbook,rowAccessWindowSize, compressTmpFiles, true);
} }
/** /**

5
fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/streaming/SheetDataWriter.java

@ -36,6 +36,7 @@ import com.fr.third.v2.org.apache.poi.ss.usermodel.Cell;
import com.fr.third.v2.org.apache.poi.ss.usermodel.CellStyle; import com.fr.third.v2.org.apache.poi.ss.usermodel.CellStyle;
import com.fr.third.v2.org.apache.poi.ss.usermodel.CellType; import com.fr.third.v2.org.apache.poi.ss.usermodel.CellType;
import com.fr.third.v2.org.apache.poi.ss.usermodel.FormulaError; import com.fr.third.v2.org.apache.poi.ss.usermodel.FormulaError;
import com.fr.third.v2.org.apache.poi.ss.usermodel.RichTextString;
import com.fr.third.v2.org.apache.poi.ss.util.CellReference; import com.fr.third.v2.org.apache.poi.ss.util.CellReference;
import com.fr.third.v2.org.apache.poi.util.POILogFactory; import com.fr.third.v2.org.apache.poi.util.POILogFactory;
import com.fr.third.v2.org.apache.poi.util.POILogger; import com.fr.third.v2.org.apache.poi.util.POILogger;
@ -315,7 +316,9 @@ public class SheetDataWriter implements Closeable {
} }
case STRING: { case STRING: {
if (_sharedStringSource != null) { if (_sharedStringSource != null) {
XSSFRichTextString rt = new XSSFRichTextString(cell.getStringCellValue()); //XSSFRichTextString rt = new XSSFRichTextString(cell.getStringCellValue());
RichTextString rt = cell.getRichStringCellValue();
int sRef = _sharedStringSource.addSharedStringItem(rt);
int sRef = _sharedStringSource.addSharedStringItem(rt); int sRef = _sharedStringSource.addSharedStringItem(rt);
writeAttribute("t", STCellType.S.toString()); writeAttribute("t", STCellType.S.toString());

Loading…
Cancel
Save