Author: fanningpj
Date: Wed Jan  8 11:21:24 2025
New Revision: 1922986

URL: http://svn.apache.org/viewvc?rev=1922986&view=rev
Log:
[bug-69529] try to workaround cells with numeric type whose format cannot be 
applied

Modified:
    
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java?rev=1922986&r1=1922985&r2=1922986&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java
 (original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java
 Wed Jan  8 11:21:24 2025
@@ -396,6 +396,10 @@ public class XSSFSheetXMLHandler extends
                                 thisStr = formatter.formatRawCellContents(d, 
this.formatIndex, this.formatString);
                             } catch (NumberFormatException e) {
                                 // Formula is a String result not a Numeric one
+                                LOG.atInfo().log(
+                                        "Error formatting cell '{}' - will use 
its raw value instead (format '{}')",
+                                        cellRef,
+                                        this.formatString);
                                 thisStr = fv;
                             }
                         } else {
@@ -431,8 +435,10 @@ public class XSSFSheetXMLHandler extends
                             thisStr = formatter.formatRawCellContents(
                                     Double.parseDouble(n), this.formatIndex, 
this.formatString);
                         } catch (NumberFormatException e) {
-                            LOG.atInfo().log("Error formatting cell '{}' - 
will use its raw value instead",
-                                    cellRef);
+                            LOG.atInfo().log(
+                                    "Error formatting cell '{}' - will use its 
raw value instead (format '{}')",
+                                    cellRef,
+                                    this.formatString);
                             thisStr = n;
                         }
                     } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to