Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jxl.read.biff.biffeException:无法识别OLE流_Java_Android_Excel_Xlsx - Fatal编程技术网

Java jxl.read.biff.biffeException:无法识别OLE流

Java jxl.read.biff.biffeException:无法识别OLE流,java,android,excel,xlsx,Java,Android,Excel,Xlsx,我想在我的Android应用程序中打开一个Excel文件。我已将文件复制到资产文件夹asset/reference/myfile_db.xlsx。创建工作簿时出现错误jxl.read.biff.biffeException:无法识别OLE流。这是我的密码 try{ InputStream is = context.getAssets().open("Referance/myfile_db.xlsx"); if(is!=null){

我想在我的Android应用程序中打开一个Excel文件。我已将文件复制到资产文件夹asset/reference/myfile_db.xlsx。创建工作簿时出现错误jxl.read.biff.biffeException:无法识别OLE流。这是我的密码

       try{
             InputStream is = context.getAssets().open("Referance/myfile_db.xlsx");
            if(is!=null){
                Workbook w = Workbook.getWorkbook(is); //Here am getting the Error
                Sheet sheet = w.getSheet(0);
                for (int j = 0; j < sheet.getRows(); j++) {
                    Cell cell = sheet.getCell(0, j);
                    System.out.println("Col "+j+": "+cell.getContents().toString());
                    if(cell.getContents().trim().equalsIgnoreCase("Charger Rating Volts")){
                        for (int i = 0; i < sheet.getColumns(); i++) {
                            Cell cel = sheet.getCell(i, j);
                            System.out.println("Col "+j+": "+cel.getContents().toString());
                        }
                    }
                }
            }
         }catch (Exception e) {
             System.out.println("Error On Reading Excel : "+e.getMessage());
        }

此库在导入时不支持.xlsx文件格式