码迷,mamicode.com
首页 > 其他好文 > 详细

JXL获取excel批注

时间:2015-09-07 19:24:51      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:

/**
 * Jxl.jar(2.6.12)
 * @author lmiky
 * @date 2011-11-26
 */
public class JxlTest {

    /**
     * 测试获取批注
     * @author lmiky
     * @date 2011-11-26
     * @param filePath
     * @throws IOException 
     * @throws BiffException 
     */
    public void getCommentTest(String filePath) throws BiffException, IOException {
        File file = new File(filePath);
        Workbook wb = Workbook.getWorkbook(file);
        Sheet[] sheets = wb.getSheets();
        Sheet sheet = sheets[0];
        Cell[] cells = sheet.getRow(0);
        Cell cell = cells[0];
        System.out.println("内容:" + cell.getContents());
        System.out.println("批注:" + cell.getCellFeatures().getComment());
    }
    
    
    public static void main(String[] args) throws BiffException, IOException {
        new JxlTest().getCommentTest("D:/测试.xls");
    }
}

 

JXL获取excel批注

标签:

原文地址:http://www.cnblogs.com/toSeeMyDream/p/4789643.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!