惠,我在Excel工作产生与Apache POI文件。该文件必须是xlsx而不是xls。 我需要绘制一些箭头,但我无法绘制向上的箭头。 我用XSSFClientAnchor创建我的箭头,并指定行/ CEL 1和行/ CEL 2.的Apache POI XSSF不能创建一个向上的箭头
XSSFClientAnchor(INT DX1,DY1 INT,INT DX2,诠释DY2,诠释COL1,诠释ROW1,诠释COL2,INT 2行)
它只能在COL1>第2栏和行1> 2行。所以我不能得出一个向上的箭头。 如果我尝试更改值以获得向上的箭头,则生成的文件不能被Excel读取,Excel会修复其中的箭头隐藏。
这里是我的代码:
public static void test() {
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet("linechart");
XSSFDrawing pat = sheet.createDrawingPatriarch();
XSSFClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, 10, 10, 5, 5);
XSSFSimpleShape shape = pat.createSimpleShape(anchor);
shape.setShapeType(ShapeTypes.LINE);
shape.setLineWidth(4);
shape.setLineStyle(0);
shape.setLineStyleColor(0, 0, 0);
FileOutputStream fileOut;
try {
fileOut = new FileOutputStream(
"C:\\monfichier" + new Date().toString().replace(':', '_') + ".xlsx");
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
如果我试图取代: XSSFClientAnchor锚=新XSSFClientAnchor(0,0,0,0,10,10,5,5); 由: XSSFClientAnchor锚=新XSSFClientAnchor(0,0,0,0,5,5,10,10); 它的确定...
你能考这个,说我什么,你想一想。这真的很难找到信息约POI,我并没有发现这个问题...