如何从Excel单元格中提取/读取/转换信息到WebView或TextView保持格式?

时间:2014-05-04 21:03:25

标签: android excel apache-poi

如何从exsel的单元格中提取/读取/转换信息到webview或textview保持格式?

Workbook wb1 = WorkbookFactory.create(getAssets().open("bos2.xls"));
    Sheet sheet = wb1.getSheetAt(0);
    Row row = sheet.getRow(i);
    Cell prim = row.getCell(2);

    string text = prim.getStringCellValue();

    WebView myWebView2 = (WebView) findViewById(R.id.webView2);
    myWebView2.setBackgroundColor(0);
    String sum = "<!Doctype html><html><head><meta charset=utf-8></head><body>" + text + "</body></html>";
    myWebView2.loadData(sum, "text/html", "utf-8");

也许有人可以帮助我。

0 个答案:

没有答案