解决方案 »
- menuitem_Click这个事件不存在怎么办啊?
- 菜鸟问题
- c#中如何吧棋盘、棋子的图片显示到界面上???
- 关于C#2005和SQL2000连接问题
- 请问Reporting Services报表中如何显示富文本?TKS!
- datagridview显示datatable时遇到的奇怪问题.
- 请问各位高手!!
- 关于无法加载DLL文件
- 大家从哪里学的Excel?
- 工具不能用,webapplication不能创建!
- 大神都来看看——支持“MovieDBContext”上下文的模型已在数据库创建后发生更改。请考虑使用 Code First 迁移更新数据库
- DevExpress.XtraTreeList.TreeList内容发生改变事件
是否在同一单元格建立了2个批注?
此处代码:
for (int k = 0; k < AllResult[i].errorinfo[j].columnindex.Count; k++) //按单个错误所涉及的单元格数循环,设置错误包含单元格的格式
{
//建立批注
comment1 = patr.CreateCellComment(anchor) as HSSFComment;
comment1.String = new HSSFRichTextString(AllResult[i].errorinfo[j].errorInfo);
comment1.Author = "XXXX设计";
//错误所在的列号
int coli = (int)AllResult[i].errorinfo[j].columnindex[k];
HSSFCell cell = (HSSFCell)row.GetCell(coli);//包含错误的单元格
cell.CellComment = comment1;
cell.CellStyle = hfctyle;
}改为:
for (int k = 0; k < AllResult[i].errorinfo[j].columnindex.Count; k++) //按单个错误所涉及的单元格数循环,设置错误包含单元格的格式
{
//错误所在的列号
int coli = (int)AllResult[i].errorinfo[j].columnindex[k];
HSSFCell cell = (HSSFCell)row.GetCell(coli);//包含错误的单元格
if (cell.CellComment == null)
{
//建立批注
comment1 = patr.CreateCellComment(anchor) as HSSFComment;
comment1.String = new HSSFRichTextString(AllResult[i].errorinfo[j].errorInfo);
comment1.Author = "数据比对助手";
cell.CellComment = comment1;
}
else
{
//原批注文本
string commentstr = cell.CellComment.String.String;
cell.CellComment.String = new HSSFRichTextString(commentstr + "\r\n" + AllResult[i].errorinfo[j].errorInfo);
}