此内容没有您所选择的语言版本。

Chapter 19. The Microsoft® Excel® spreadsheet application


Seam can generate Microsoft® Excel® spreadsheets through the JExcelAPI library. The document generated is compatible with Microsoft Excel versions 95, 97, 2000, XP, and 2003. At present, only a limited subset of the library functionality is available. Refer to the JExcelAPI documentation for more information about limitations and capabilities.

19.1. Microsoft Excel support

To include Microsoft Excel support in your application, you must include jboss-seam-excel.jar and jxl.jar in your WEB-INF/lib directory. jboss-seam-excel.jar contains the Microsoft Excel JSF controls used to construct views for document rendering, and the DocumentStore component, which serves the rendered document to the user. You will also need to configure the DocumentStore Servlet in your web.xml file. The Microsoft Excel Seam module requires the seam-ui package, and that Facelets be used as the view technology.
You can see an example of Microsoft Excel support in action in the examples/excel project. This demonstrates the exposed functionality of the support, as well as correct deployment packaging.
You can easily customize the module to support other kinds of Microsoft Excel spreadsheet. Implement the ExcelWorkbook interface and register the following in components.xml:
<excel:excelFactory> 
  <property name="implementations"> 
    <key>myExcelExporter</key> 
    <value>my.excel.exporter.ExcelExport</value> 
  </property> 
</excel:excelFactory>
Copy to Clipboard Toggle word wrap
Register the Microsoft Excel namespace in the components tag like so:
xmlns:excel="http://jboss.com/products/seam/excel"
Copy to Clipboard Toggle word wrap
Then set the UIWorkbook type to myExcelExporter to use your own preferred exporter. The default here is jxl, but you can also use CSV with the csv type.
See Section 18.6, “Configuring iText” for information about how to configure the document servlet for serving documents with an .xls extension.
If you have trouble accessing the generated file under Microsoft® Internet Explorer®, especially with HTTPS, check that your web.xml or browser security constraints (see http://www.nwnetworks.com/iezones.htm/) are not too strict.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat