//方法包含:
public Object [] [] getExcelData(String excelLocation){
$(document).ready(function () {
var getData = GetData();
var $data = $('#dataDisplay');
function listData(response, passdata) {
var data = response;
var passeddata = passdata;
$.each(data, function (i, users) {
$data.append('<li>' + '<span>' + users.name + '</span>' + '<br> <span>' + users.email + '</span>' + ' </li>');
});
//adds li dynamically
$("li").append('<i class="material-icons delete">' + "delete" + '</i>');
$("li").append('<i class="material-icons edit">' + "edit" + '</i>');
}
});
//获取活动行的总数
Object[][] dataSet = null;
try {
file = new FileInputStream(excelLocation);
wrkbook = new XSSFWorkbook(file);
wrkbook.close();
sheet = wrkbook.getSheetAt(0);
//获取活动列总数
int rowNum = sheet.getLastRowNum();
//如果有任何异常,则返回null
答案 0 :(得分:0)
如果要以二维数组形式从电子表格中返回列值,请更改方法的签名以返回String [] []类型的数组,遍历电子表格的每一行,并添加所有值将其列插入数组,并在完成后返回Array。我还没有测试过,但是应该很接近:
down