Skip to content

Commit b128e1f

Browse files
committed
use SpreadsheetVersion.EXCEL2007.getMaxTextLength()
1 parent eb4de76 commit b128e1f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email

dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.dolphinscheduler.plugin.alert.email.exception.AlertEmailException;
2222

2323
import org.apache.commons.collections4.CollectionUtils;
24+
import org.apache.poi.ss.SpreadsheetVersion;
2425
import org.apache.poi.ss.usermodel.Cell;
2526
import org.apache.poi.ss.usermodel.CellStyle;
2627
import org.apache.poi.ss.usermodel.HorizontalAlignment;
@@ -138,7 +139,7 @@ public static void genExcelFile(String content, String title, String xlsFilePath
138139
*/
139140
public static int setCellValueWithSplit(Row row, int colIndex, CellStyle cellStyle, Object value) {
140141
String cellValue = String.valueOf(value);
141-
int maxLen = 32767;
142+
int maxLen = SpreadsheetVersion.EXCEL2007.getMaxTextLength();
142143
if (cellValue.length() > maxLen) {
143144
int parts = (cellValue.length() + maxLen - 1) / maxLen;
144145
for (int p = 0; p < parts; p++, colIndex++) {

0 commit comments

Comments
 (0)