我试图从excel文件中读取表单控件。我正在使用smartXLS api。
在我的excel文件单元格"c2“中有列表框(formControl)。现在我想读一下那个控件。
我尝试使用下面的代码,但它引发了一个异常
workBook.readXLSX("D:\\TestAssessment.xlsx");
//This row throws an exception.
//Here I was passed parameters in function as getFormControl(rowIndex,columnIndex)
FormControlShape fm = (FormControlShape)workBook.getFormControl(1, 2);有人知道为什么会抛出异常吗?
发布于 2017-08-11 11:15:59
我读过SmartXLS javaDoc。
FormControlShape shape = workBook.getFormControl(FormControlShape.ListBox, listBoxId);
// Here FormControlShape is inbuilt enum for to pass which type of form control you need to read/get.
// listBoxId is integer for index of the form control.发布于 2015-08-21 15:08:13
getFormControl(int type, int index)
get the specified index formcontrol from the current sheet这是描述该方法的smartXLS的javadoc。参数int type表示窗体控件的类型;类型: 20-ComBox 11-复选框18-ListBox。参数int index表示窗体控件的索引。
希望这能帮到你。
https://stackoverflow.com/questions/29766527
复制相似问题