Apache Poi 简明教程

Apache POI - Java Excel APIs

本章介绍了一些 Java Excel API 的演变及其功能。许多供应商提供了 Java Excel 相关的 API;本章中考虑了一些。

This chapter takes you through some of the flavors of Java Excel API and their features. There are many vendors who provide Java Excel related APIs; some of them are considered in this chapter.

Aspose Cells for Java

Aspose Cells for Java 是由供应商 Aspose 开发和分发的纯许可 Java Excel API。最新版本是 8.1.2,发布于 2014 年 7 月。这是一个丰富且重量级的 API(纯 Java 类和 AWT 类的组合),用于设计可以读取、写入和操作电子表格的 Excel 组件。

Aspose Cells for Java is a purely licensed Java Excel API developed and distributed by the vendor Aspose. The latest version of this API is 8.1.2, released in July 2014. It is a rich and heavy API (combination of plain Java classes and AWT classes) for designing the Excel component that can read, write, and manipulate spreadsheets.

此 API 的常见用途如下 −

The common uses of this API are as follows −

  1. Excel reporting, build dynamic Excel reports

  2. High-fidelity Excel rendering and printing

  3. Import and export data from Excel spreadsheets

  4. Generate, edit, and convert spreadsheets

JXL

JXL 是一个专为 Selenium 设计的第三方框架,支持网络浏览器上的数据驱动自动化(网络浏览器上的数据自动更新)。但是它也被用作 JExcel API 的普通支持库,因为它具有创建、读取和写入电子表格的基本功能。

JXL is a third-party framework designed for Selenium that supports data driven automation on web browsers (auto-update of data on web browsers). However it is also used as a common support library for JExcel API because it has basic features to create, read, and write spreadsheets.

基本功能如下 −

The basic features are as follows −

  1. Generate Excel files

  2. Import data from workbooks and spreadsheets

  3. Obtain the total number of rows and columns

Note − JXL 仅支持 .xls 文件格式,并且无法处理较大的数据量。

Note − JXL supports only .xls file format and it cannot handle large data volume.

JExcel

JExcel 是 Team Dev 提供的一个纯粹许可的 API。通过使用此 API,程序员能轻松使用 .xls.xlsx 格式读取、编写、显示和修改 Excel 工作簿。此 API 能轻松与 Java Swing 和 AWT 嵌入。此 API 的最新版本是 2009 年发布的 Jexcel-2.6.12。

JExcel is a purely licensed API provided by Team Dev. Using this, programmers can easily read, write, display, and modify Excel workbooks in both .xls and .xlsx formats. This API can be easily embedded with Java Swing and AWT. The latest version of this API is Jexcel-2.6.12, released in 2009.

主要功能如下:

The main features are as follows −

  1. Automate Excel application, workbooks, spreadsheets, etc

  2. Embed workbooks in a Java Swing application as ordinary Swing component

  3. Add event listeners to workbooks and spreadsheets

  4. Add event handlers to handle the behavior of workbook and spreadsheet events

  5. Add native peers to develop custom functionality

Apache POI

Apache POI 是 Apache Software Foundation 提供的 100% 开源库。大多数中小型应用程序开发人员都严重依赖 Apache POI(HSSF + XSSF)。它支持 Excel 库的所有基本功能;然而,呈现和文本提取是它的主要功能。

Apache POI is a 100% open source library provided by Apache Software Foundation. Most of the small and medium scale application developers depend heavily on Apache POI (HSSF + XSSF). It supports all the basic features of Excel libraries; however, rendering and text extraction are its main features.

circle