合并单元格的 CFSpreadsheet 边框

CFSpreadsheet borders for Merged Cells

我搜索了一段时间,如果已经有答案,请原谅我。我在使用 CFSpreadsheet 将边框应用于合并单元格时遇到问题。下面是一些示例代码。

<cfscript>
newSS = SpreadsheetNew('Testing');      //Create Spreadsheet    

SpreadsheetMergeCells(newSS,1,1,1,9);
SpreadsheetAddRow(newSS,'Underline this Header');
SpreadSheetFormatCell(newSS,{bold=true,alignment='center',bottomborder='thin'},1,1);    

Spreadsheetwrite(newSS,expandpath('myTest.xls'),true);  //Write File
</cfscript>

我希望顶部单元格始终带有下划线。我得到的是顶部单元格仅通过 "A" 列加下划线,之后没有加下划线。无论如何,这是否只是 CFSpreadsheet 的限制??

谢谢!

根据POI FAQ's,即CF用于生成电子表格的底层库,目前不支持(强调我的):

12. How do I add a border around a merged cell?

Add blank cells around where the cells normally would have been and set the borders individually for each cell. We will probably enhance HSSF in the future to make this process easier.

你现在能做的最好的事情可能是使用 SpreadsheetFormatCellRange 而不是 SpreadSheetFormatCell:

SpreadsheetFormatCellRange ( newSS
                , {bold=true,alignment='center',bottomborder='thin'}
                , 1,1,1,9 );