hssfsheet sheet = workbook.createsheet("template page");
// 建立繪圖物件
hssfpatriarch p = sheet.createdrawingpatriarch();
hssfcellstyle cellstyle = workbook.createcellstyle();
hssfdataformat dataformat = workbook.createdataformat();
hssfrow row2 = sheet.createrow(1);
for (int i = 0; i < strdata.length; i++)
}hssfcell cell_2 = row2.createcell((short) 7);
cell_2.setcellvalue(12);
cellstyle.setdataformat(dataformat.getformat("####"));
// 前四個引數是座標點,後四個引數是編輯和顯示批註時的大小.
hssfcomment comment = p.createcomment(new hssfclientanchor(0, 0, 0, 0,
(short) 10, 7, (short) 12, 13));
// 輸入批註資訊
comment.setstring(new hssfrichtextstring(
"system:\n\t1. 不能為空.\n\t2. 不能為負數"));
comment.setvisible(true);
// 將批註新增到單元格物件中
cell_2.setcellcomment(comment);
JXL獲取excel批註
不知道為什麼,竟然google上竟然都搜不到jxl獲取excel批註的方法,只能自己去看api,然後寫了個最簡單的測試 我用了jxl最新的2.6.12版本,竟然還不支援office的xlsx格式 jxl.jar 2.6.12 author lmiky date 2011 11 26 public c...
NPOI建立批註
很多人不怎麼用excel中的批註,所以我特地截了張圖,我們先看一下批註的效果圖 批註主要有三個屬性需要設定,乙個是批註的位置和大小 乙個是批註的文字 還有乙個是批註的作者,批註的位置和大小,在excel中是與單元格密切相關的,npoi中通過hssfclientanchor或者xssfclientan...
VBA 插入批註
sub pictopz dim cell as range,fd,t,w as byte,h as byte selection.clearcomments if selection 1 then msgbox 不能選擇空白區。64,提示 exit sub on error resume next ...