tracker issue : CF-4203361

select a category, or use search below
(searches all categories and all time range)
Title:

POI XSSF cell comment error

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): A. Bakia / ()

Created: 09/29/2018

Components: Document Management, Office Integration

Versions: 2016,13.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: 2018,0,01,308605 / 2018,0,0,311568

Priority/Frequency: Normal / Few users will encounter

Locale/System: English / Windows 7 SP1 64-bit

Vote Count: 0

Problem Description: 
The function 

spreadsheetSetCellComment(doc,commentStruct,rowNumber,colNumber)

causes an error when doc is of type XLSX. However, it works as expected when doc is of type XLS. The error message is "Multiple cell comments in one cell are not allowed, cell: E9".

Steps to Reproduce:
If you run the following code, you will reproduce the issue

<cfscript>
  myDoc = spreadsheetNew("Test", true);
  setComments(myDoc);
  // Use your own file path here
  spreadsheetwrite(myDoc, "C:\Users\bkbk\Desktop\test.xlsx",true);

  //function to write some data and comments to the spreadsheet
  function setComments(doc){
    var commentStruct={};
    for(var row = 1; row <= 50; row += 1){
      for(var col = 1; col <= 50; col += 1){
       	commentStruct={comment="#row#,#col#"};
	spreadsheetSetCellValue(arguments.doc, "row: #row#, col: #col#", row, col);
        spreadsheetSetCellComment(arguments.doc,commentStruct,row,col);
      }
    }
  }
</cfscript>

Actual Result:
An error: "Multiple cell comments in one cell are not allowed, cell: E9". See attached PDF.

It is clear that row 9 is involved in the error. So, let's experiment by replacing the line 

 spreadsheetSetCellComment(arguments.doc,commentStruct,row,col);

with

if (row != 9 ) {
    spreadsheetSetCellComment(arguments.doc,commentStruct,row,col);
 }

You will get no error. However, you strangely still get an Excel sheet that includes a 9th row. The row's cells have no comment.

Expected Result:
No error and no strange behaviour in the 9th row.

Any Workarounds:
None known.
Use XLS instead, though this is not a workaround.

Attachments:

Comments: