jxl添加圖片到excel

  String imgPath = request.getSession().getServletContext().getRealPath("/");
                String path=(imgPath+"jdy"+File.separator+"scgl"+File.separator+"zsyq"+File.separator+"nyywzyz.png");
                File imgFile = new File(path);
                WritableImage image = new WritableImage(7,(rowNum-2),2,8,imgFile); //col row是圖片的起始行起始列  width height是定義圖片跨越的行數與列數
                ws.addImage(image);


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章