<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                #### 4.2 html轉Excel更神奇的導出 這個是一個MM提出的需求,需求原因是,她要導出一個比較復雜的Excel,無論用模板還是注解都比較難實現,所以她想到了這個方案,然后就實現了如下的方法,我的使用方法如下 自己搞個html,然后用模板引擎,beetl,freemark等生成html,然后調用autopoi提供的方法轉換成Excel,因為html的標簽以及規則大家比Excel要熟悉的多,更容易編寫復雜的table,然后autopoi轉換成Excel再導出,麻煩了點,但是可以處理一些特定的情況,也同樣生成兩個版本的Excel都支持 使用demo ~~~ @Test public void htmlToExcelByStr() throws Exception { StringBuilder html = new StringBuilder(); Scanner s = new Scanner(getClass().getResourceAsStream("/html/sample.html"), "utf-8"); while (s.hasNext()) { html.append(s.nextLine()); } s.close(); Workbook workbook = ExcelXorHtmlUtil.htmlToExcel(html.toString(), ExcelType.XSSF); File savefile = new File("D:\\home\\lemur"); if (!savefile.exists()) { savefile.mkdirs(); } FileOutputStream fos = new FileOutputStream("D:\\home\\lemur\\htmlToExcelByStr.xlsx"); workbook.write(fos); fos.close(); workbook = ExcelXorHtmlUtil.htmlToExcel(html.toString(), ExcelType.HSSF); fos = new FileOutputStream("D:\\home\\lemur\\htmlToExcelByStr.xls"); workbook.write(fos); fos.close(); } @Test public void htmlToExcelByIs() throws Exception { Workbook workbook = ExcelXorHtmlUtil.htmlToExcel(getClass().getResourceAsStream("/html/sample.html"), ExcelType.XSSF); File savefile = new File("D:\\home\\lemur"); if (!savefile.exists()) { savefile.mkdirs(); } FileOutputStream fos = new FileOutputStream("D:\\home\\lemur\\htmlToExcelByIs.xlsx"); workbook.write(fos); fos.close(); workbook = ExcelXorHtmlUtil.htmlToExcel(getClass().getResourceAsStream("/html/sample.html"), ExcelType.HSSF); fos = new FileOutputStream("D:\\home\\lemur\\htmlToExcelByIs.xls"); workbook.write(fos); fos.close(); } ~~~ 提供了流或者字符串的入參,內部都多了緩存,多次生成不會重復解析
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看