https://bz.apache.org/bugzilla/show_bug.cgi?id=59361

            Bug ID: 59361
           Summary: Opening existing workbook and writing to new file
                    changes the data validation rules <f> tag contents
           Product: POI
           Version: 3.14-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]

Reproduction steps:

1. Have an existing XLSX file (call it a template), that has data validation
rules defined on certain cells
2. Open the file and parse it with XSSF 
3. Select the worksheet that has data validation and change at least one cell's
value
4. Output the updated workbook into a new file.

Observed behaviour:

The XML file for the template stores the data validation rules with HTML codes
when describing "greater than" or "less than" rules. The result file has these
HTML codes replaced with the character possibly causing issues with the parsing
& validation application. Example:

Template file <worksheet1.xml>
-------------
<f t="shared" ref="CD5:CD36" si="33">
IF(ISERROR(OR(N5&lt;&gt;INT(N5),NOT(ISNUMBER(N5)))),1,IF(OR(N5&lt;&gt;INT(N5),NOT(ISNUMBER(N5))),1,0))</f>

...

<f t="shared" ref="CF5:CF36" si="35">
IF(AND(AP5&gt;0,ISBLANK(R5),ISBLANK($R$4)),1,0)</f>
-------------

Results file <worksheet1.xml>
-------------
<f t="shared" ref="CD5:CD36" si="33">
IF(ISERROR(OR(N5&lt;>
INT(N5),NOT(ISNUMBER(N5)))),1,IF(OR(N5&lt;>
INT(N5),NOT(ISNUMBER(N5))),1,0))</f>

...

<f t="shared" ref="CF5:CF36" si="35">
IF(AND(AP5>
0,ISBLANK(R5),ISBLANK($R$4)),1,0)</f>
-------------

Symptom:

When opening the result file with Excel, the validation seems to be broken,
i.e. misfiring and marking fields that pass failed, and vice versa.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to