我试图在java中使用jxl将HYPERLINK写入excel,但写入失败如下所示。请建议可以做什么
String scn = "=HYPERLINK(\"D:\\snaps\\"+step_num+".jpg\",\"Click\")";
Formula link = new Formula(3,0,scn);
wws.addCell(link);
java.util.EmptyStackException
at java.util.Stack.peek(Unknown Source)
at java.util.Stack.pop(Unknown Source)
at jxl.biff.formula.BinaryOperator.getOperands(BinaryOperator.java:61)
at jxl.biff.formula.StringFormulaParser.parseCurrent(StringFormulaParser.java:240)
at jxl.biff.formula.StringFormulaParser.parse(StringFormulaParser.java:113)
at jxl.biff.formula.FormulaParser.parse(FormulaParser.java:129)
at jxl.write.biff.FormulaRecord.initialize(FormulaRecord.java:160)
at jxl.write.biff.FormulaRecord.setCellDetails(FormulaRecord.java:243)
at jxl.write.biff.WritableSheetImpl.addCell(WritableSheetImpl.java:1155)
at framework.WrapperMethods.writeExcel(WrapperMethods.java:174)
at framework.WrapperMethods.setValueById(WrapperMethods.java:80)
at sample.T24Login.main(T24Login.java:55)
答案 0 :(得分:0)
删除=
来自
String scn = "=HYPERLINK(\"D:\\snaps\\"+step_num+".jpg\",\"Click\")";
到
String scn = "HYPERLINK(\"D:\\snaps\\"+step_num+".jpg\",\"Click\")";