绘制一个透明的斜线图片,在插入对应的单元格即可,这样就不会遮盖下面的文字;
下面的代码将斜线图片插入到第1列第三行的位置, 高宽都是2个单元格;
WritableImage image = new WritableImage(0,2,2,2, new File(session.getServletContext().getRealPath("/")+ "/images/line.png")); sheet.addImage(image);
斜线图片如下: