apache poi教程_Apache POI教程

apache poi教程

Welcome to Apache POI Tutorial. Sometimes we need to read data from Microsoft Excel Files or we need to generate reports in Excel format, mostly for Business or Finance purposes. Java doesn’t provide built-in support for working with excel files, so we need to look for open source APIs for the job. When I started the hunt for Java APIs for excel, most of the people recommended JExcel or Apache POI.

欢迎使用Apache POI教程。 有时我们需要从Microsoft Excel文件中读取数据,或者我们需要以Excel格式生成报告,主要用于商业或财务目的。 Java不提供使用excel文件的内置支持,因此我们需要为此工作寻找开源API。 当我开始搜寻excel的Java API时,大多数人都推荐JExcel或Apache POI。

After further research, I found that Apache POI is the way to go for following main reasons. There are some other reasons related to advanced features but let’s not go into that much detail.

经过进一步的研究,我发现Apache POI是行之有效的,其主要原因如下。 还有其他一些与高级功能有关的原因,但让我们不再赘述。

  • Backing of Apache foundation.

    Apache基础的后盾。
  • JExcel doesn’t support xlsx format whereas POI supports both xls and xlsx formats.

    JExcel不支持xlsx格式,而POI支持xls和xlsx格式。
  • Apache POI provides stream-based processing, that is suitable for large files and requires less memory.

    Apache POI提供基于流的处理,该处理适用于大文件且需要较少的内存。

Apache POI (Apache POI)

Apache POI provides excellent support for working with Microsoft Excel documents. Apache POI is able to handle both XLS and XLSX formats of spreadsheets.

Apache POI为使用Microsoft Excel文档提供了出色的支持。 Apache POI能够处理电子表格的XLS和XLSX格式。

Some important points about Apache POI API are:

关于Apache POI API的一些重要点是:

  1. Apache POI contains HSSF implementation for Excel ’97(-2007) file format i.e XLS.

    Apache POI包含用于Excel '97(-2007)文件格式(即XLS)的HSSF实现。
  2. Apache POI XSSF implementation should be used for Excel 2007 OOXML (.xlsx) file format.

    Apache POI XSSF实现应用于Excel 2007 OOXML(.xlsx)文件格式。
  3. Apache POI HSSF and XSSF API provides mechanisms to read, write or modify excel spreadsheets.

    Apache POI HSSF和XSSF API提供了读取,写入或修改excel电子表格的机制。
  4. Apache POI also provides SXSSF API that is an extension of XSSF to work with very large excel sheets. SXSSF API requires less memory and is suitable when working with very large spreadsheets and heap memory is limited.

    Apache POI还提供了SXSSF API,它是XSSF的扩展,可以与非常大的ex​​cel工作表一起使用。 SXSSF API需要较少的内存,适用于处理非常大的电子表格且堆内存受限制的情况。
  5. There are two models to choose from – event model and user model. Event model requires less memory because the excel file is read in tokens and requires processing them. User model is more object oriented and easy to use and we will use this in our examples.

    有两种模型可供选择-事件模型和用户模型。 事件模型需要较少的内存,因为excel文件是在令牌中读取并需要对其进行处理的。 用户模型更加面向对象并且易于使用,我们将在示例中使用它。
  6. Apache POI provides excellent support for additional excel features such as working with Formulas, creating cell styles by filling colors and borders, fonts, headers and footers, data validations, images, hyperlinks etc.

    Apache POI为其他excel功能提供了出色的支持,例如使用公式,通过填充颜色和边框,字体,页眉和页脚,数据验证,图像,超链接等来创建单元格样式。

Apache POI Maven依赖关系 (Apache POI Maven Depende

你可能感兴趣的:(java,大数据,poi,机器学习,excel)