• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Spreadsheet comments in xmlformat cause exception

New Here ,
Sep 28, 2018 Sep 28, 2018

Copy link to clipboard

Copied

I've ran into a strange issue while working with comments in excel spreadsheets. When not using xmlformat (.xls) comments work fine, but if I start using xmlformat (.xlsx) I start getting "Multiple cell comments in one cell are not allowed".  I'm running ColdFusion 2016

I'm including a snippet of code below that will work fine for .xls style documents but error out for .xlsx style documents.

<cfscript>

  // Runs without error

  mydoc = spreadsheetNew("Test", false);

  setComments(mydoc);

  spreadsheetwrite(mydoc, "#expandPath("./")#test.xls",true);

  writeoutput('<a href="./test.xls">Download good</a><br>');

  //Throws java.lang.IllegalArgumentException: Multiple cell comments in one cell are not allowed, cell: E9

  mydoc2 = spreadsheetNew("Test", true);

  setComments(mydoc2);

  spreadsheetwrite(mydoc2, "#expandPath("./")#test.xls",true);

  writeoutput('<a href="./test2.xlsx">Download bad</a>');

 

  //write some data and comments to the spreadsheet

  function setComments(doc){

    for(row = 1; row <= 50; row += 1){

      for(col = 1; col <= 50; col += 1){

        spreadsheetSetCellValue(doc, "row: #row#, col: #col#", row, col);

        SpreadsheetSetCellComment(doc,{comment:"(#row#,#col#)"},row, col);

      }

    }

  }

</cfscript>

Is there some difference in using .xlsx that I don't know about, or is this a bug within ColdFusion?

Thanks,

Chris

Views

232

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 29, 2018 Sep 29, 2018

Copy link to clipboard

Copied

LATEST

Hi christophere99273954​,

I think it is a bug. I have been able to confirm it on ColdFusion 2018 and have reported the ColdFusion bug, POI XSSF cell comment error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation