pjfanning commented on code in PR #17283:
URL: 
https://github.com/apache/dolphinscheduler/pull/17283#discussion_r2173713858


##########
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java:
##########
@@ -124,5 +126,35 @@ public static void genExcelFile(String content, String 
title, String xlsFilePath
             throw new AlertEmailException("generate excel error", e);
         }
     }
-
+    /**
+     * Writes a value to Excel cells, splitting the value into multiple 
adjacent cells
+     * if the string length exceeds the Excel cell limit (32767 characters).
+     *
+     * @param row       the Excel row to write to
+     * @param colIndex  the starting column index
+     * @param cellStyle the cell style to apply
+     * @param value     the value to write
+     * @return the next available column index after writing
+     */
+    public static int setCellValueWithSplit(Row row, int colIndex, CellStyle 
cellStyle, Object value) {
+        String cellValue = String.valueOf(value);
+        int maxLen = 32767;

Review Comment:
   POI provides a way to get this instead of hardcoding this here.
   
https://github.com/apache/poi/blob/trunk/poi/src/main/java/org/apache/poi/ss/SpreadsheetVersion.java
   
   org.apache.poi.ss.SpreadsheetVersion.EXECEL2007.getMaxTextLength()
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to