eXtremeTable體驗

          ???最近做excel,pdf導(dǎo)出,拿出最早的jxl.jar的程序出來看了下,太煩了,早先玩過displaytag,拿出來試了下,還行,excel到是出來,PDF中文不行,所以決定嘗試下eXtremeTable,從http://extremecomponents.org下載到最近的1.0.1版本,唉,文檔,build.xml全沒,說實話這個開源項目這方面做的的確不咋的,費了些時間把相關(guān)的jar庫放到lib,和web.xml的一些配置做好
          <?xml?version="1.0"?encoding="ISO-8859-1"?>?????????????
          <web-app?xmlns="http://java.sun.com/xml/ns/j2ee"
          ???xmlns:xsi
          ="http://www.w3.org/2001/XMLSchema-instance"
          ???xsi:schemaLocation
          ="http://java.sun.com/xml/ns/j2ee?http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
          ???version
          ="2.4">???????????
          ????
          <taglib>
          ????
          <taglib-uri>/tld/extremecomponents</taglib-uri>
          ????
          <taglib-location>/WEB-INF/tld/extremecomponents.tld</taglib-location>
          ????
          </taglib>??
          ????
          ????
          <filter>
          ????????
          <filter-name>eXtremeExport</filter-name>
          ????????
          <filter-class>org.extremecomponents.table.filter.ExportFilter</filter-class>
          ????
          </filter>
          ????
          ????
          <filter-mapping>
          ????????
          <filter-name>eXtremeExport</filter-name>
          ????????
          <url-pattern>/*</url-pattern>
          ????
          </filter-mapping>

          </web-app>
          測試test.jsp頁面,注意tld的路徑.
          經(jīng)過一段時后.......終于搞定,唉,汗
          從官方網(wǎng)站上抄了一個導(dǎo)出excel,pdf的例子
          <ec:table?
          ????
          var="pres"?
          ????items
          ="pres"
          ????action
          ="${pageContext.request.contextPath}/test2.jsp"?
          ????imagePath
          ="${pageContext.request.contextPath}/images/table/compact/*.gif"
          ????view
          ="compact"
          ????title
          =""
          ????showTooltips
          ="true"
          ????filterable
          ="false"
          ??????????????
          >
          ??????
          <ec:exportPdf?
          ???????????
          fileName="output.pdf"?
          ???????????tooltip
          ="Export?PDF"?
          ???????????headerColor
          ="black"?
          ???????????headerBackgroundColor
          ="#b6c2da"?
          ???????????headerTitle
          ="Presidents"
          ???????????text
          ="PDF"
          ???????????
          />
          ??????
          <ec:exportXls
          ???????????
          fileName="output.xls"?
          ???????????tooltip
          ="Export?Excel"
          ???????????text
          ="XLS"
          ???????????
          />
          ????????
          <ec:row>
          ????????????
          <ec:column?property="name"/>
          ????????????
          <ec:column?property="nickname"/>
          ????????????
          <ec:column?property="term"/>
          ????????
          </ec:row>
          ??
          </ec:table>
          注意我加的filerable是去掉按某個屬性查詢的功能,經(jīng)測試,中文在上面基本沒用......
          好了,回歸正題,我們主要的問題是導(dǎo)出PDF中文的問題,如何做請查看這篇文章http://www.aygfsteel.com/lucky/archive/2006/03/10/34717.html,我只做一些補充,讓用到的朋友少走些彎路,關(guān)于FOP看了上文中推薦IBM上的文章差不多就明白了.
          這里主要講的就是userconfig.xml這個配置文件
          如果你出現(xiàn)
          [ERROR] Failed to read a font metrics file: Invalid font metrics file: arialuni.
          xml (no protocol: arialuni.xml)
          [ERROR] unknown font arialuni,normal,normal so defaulted font to any
          [ERROR] unknown font arialuni,normal,normal so defaulted font to any
          這種類似的錯誤,都是因為userconfig.xml配置文件沒有寫對,現(xiàn)在給出我的
          <configuration>
          <fonts>
          ???
          <font?metrics-file="E:/jakarta-tomcat-5.5.10/eXtremeComponents/WEB-INF/classes/org/extremecomponents/resource/fonts/arialuni.xml"?embed-file="E:/jakarta-tomcat-5.5.10/eXtremeComponents/WEB-INF/classes/org/extremecomponents/resource/fonts/arialuni.ttf"?kerning="yes">
          ????
          <font-triplet?name="arialuni"?style="normal"?weight="normal"/>
          ????
          <font-triplet?name="arialuni"?style="normal"?weight="bold"/>
          ????
          <font-triplet?name="arialuni"?style="italic"?weight="normal"/>
          ????
          <font-triplet?name="arialuni"?style="italic"?weight="bold"/>
          ???
          </font>
          </fonts>
          </configuration>
          至此所有問題全部解決,系統(tǒng)正式用上eXtremetable,目前感覺還不錯.

          posted on 2006-09-21 20:11 The One 閱讀(611) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          <2006年9月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿(3)

          隨筆檔案(11)

          相冊

          我的郵箱

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 游戏| 太康县| 南投市| 泽库县| 甘德县| 屯留县| 旌德县| 阆中市| 齐齐哈尔市| 临朐县| 长垣县| 军事| 和政县| 靖西县| 浏阳市| 包头市| 边坝县| 梓潼县| 长白| 开封县| 宽甸| 清新县| 黎城县| 景德镇市| 长汀县| 九龙县| 临西县| 瑞安市| 湛江市| 贵州省| 屏东市| 中超| 太仆寺旗| 如皋市| 奉贤区| 出国| 长白| 泸州市| 益阳市| 晋江市| 黎城县|