小编ket*_*eng的帖子

来自Apache POI的文件Excel由Excel女士打开(损坏)

我不知道为什么使用POI编写的文件不能由Excel 2013打开,但POI仍然可以读取该文件.(单元格值可以更改)

是文件中的错误

这是代码

FileInputStream fis = null;
    try {
        fis = new FileInputStream(fileUri); //not error at fileUri
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    String urii = fileUri.replace(".xls", "0.xls"); //not error
    File fisx = new File(urii);

    Workbook workbook = null;
        workbook = new HSSFWorkbook(fis);

    Sheet sheet = workbook.getSheetAt(0);

    Row row = sheet.getRow(0);

    Cell cell = row.getCell(0);

    String p = cell.getStringCellValue();

    TextView a = (TextView) findViewById(R.id.txtUri);

    cell.setCellValue(new String("popo"));
    String x = cell.getStringCellValue();

    TextView b …
Run Code Online (Sandbox Code Playgroud)

java excel android apache-poi

10
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×1

apache-poi ×1

excel ×1

java ×1