<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          easy-excelxml配置導(dǎo)入導(dǎo)出Excel

          聯(lián)合創(chuàng)作 · 2023-09-29 22:12

          省去復(fù)雜的excel代碼,使用xml配置的形式完成導(dǎo)入導(dǎo)出

          一、jar包依賴

          輸入圖片說(shuō)明

          二、如何使用?參考

          org.easy.excel.test.ExportTest

          org.easy.excel.test.ImportTest

          支持,復(fù)雜對(duì)象導(dǎo)航,支持自定義(單元格寬度) 標(biāo)題樣式(背景色,對(duì)齊方式,字體顏色)

          導(dǎo)出測(cè)試使用時(shí),運(yùn)行org.easy.excel.test.ExportTest類的測(cè)試方法,觀察具體生成的excel文件

          導(dǎo)入測(cè)試使用時(shí),運(yùn)行org.easy.excel.test.ImportTest,觀察org.easy.excel.vo.ExcelImportResult

          下面展示配置文件

          <?xml version="1.0" encoding="UTF-8"?>

          <!-- excel標(biāo)簽參看:ExcelDefinition,Field標(biāo)簽參看:FieldValue -->

          <!-- 測(cè)試使用 ,學(xué)生類-->
          <excel id="student" class="org.easy.excel.test.model.StudentModel" enable ="true">
              <field name="id" align="center" titleBgColor="dark_blue"
              columnWidth="3000" titleFountColor="white" title="ID"/>
              <field name="name" title="學(xué)生姓名" align="right"/>
              <field name="age" title="年齡" align="center" titleFountColor="red" titleBgColor="dark_blue" isNull="false" regex="^[1-9]\d*$" regexErrMsg="必須是數(shù)字"/>
              <field name="studentNo" title="學(xué)號(hào)" titleFountColor="blue" isNull="false" />
              <field name="createTime" columnWidth="4000" title="創(chuàng)建時(shí)間" pattern="yyyy-MM-dd"/>
              <field name="status" title="狀態(tài)" titleBgColor="green" format="1:正常,0:禁用,-1:無(wú)效" />
              <!-- 創(chuàng)建人,可能需要查詢數(shù)據(jù)庫(kù)校驗(yàn),這里使用自定義解析器 -->
              <field name="createUser" title="創(chuàng)建人" 
              resolveFieldValueConverterName="org.easy.excel.test.converter.CreateUserFieldValueConverter"/>
          
              <!-- 復(fù)雜對(duì)象 -->
              <field name="book.bookName" title="圖書名稱" columnWidth="6000"/>
              <field name="book.author.authorName" title="作者名稱"/>
          </excel>

          上述配置,目前以包含所有支持的可配置屬性。

          關(guān)于excel配置屬性說(shuō)明:參看org.easy.excel.vo.ExcelDefinition

          關(guān)于field配置屬性說(shuō)明參看:org.easy.excel.vo.FieldValue

          瀏覽 22
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  久久久久麻豆 | 亚洲激情视频小说 | 黄页视频在线观看免费 | 99免费视频 | 99.热|