【发布时间】:2018-03-25 13:35:09
【问题描述】:
我想在 C# 中使用 NPOI Excel 创建一个单元格注释。我没有找到任何明确的文件。下面是我自己写的。
NPOI.HSSF.Record.NoteRecord nr = new NPOI.HSSF.Record.NoteRecord();
nr.Author = "Some Author";
NPOI.HSSF.Record.TextObjectRecord tor = new NPOI.HSSF.Record.TextObjectRecord();
tor.Str = new HSSFRichTextString("something");
HSSFComment cm = new HSSFComment(nr, tor);
cm.Visible = true;
sheet.GetRow(i).Cells[k + 8].CellComment = cm;
该代码无法正常工作。我在生成的 excel 文件中看不到对该单元格的任何评论。有人知道如何在特定单元格中添加评论吗?
【问题讨论】:
标签: c# excel comments cell npoi