Are you ready? NPOI 2.0 is coming

Source: Internet
Author: User

Author: Tony Qu

 

NPOI is a well-known library at home and abroad and has become recognized as an Excel 2003 file format for reading and writing.. NET solution. A large number of companies are using this library to import and export data. Now, our NPOI team has brought you the first version of NPOI 2.0 alpha after six months of efforts. Let's take a look at what surprises this version has brought to us.

First surprise: read and write in OOXML file format. OOXML is a standard format specification added by Microsoft after Office 2007. It uses the zip format at the underlying layer, but it does not mean that as long as your program can read the zip file, it can easily read and write OOXML, to some extent, this is very difficult, because you have to maintain a large number of internal object relationships. Although they are all plain text xml, there are still many problems, if you just extract some content, maybe xpath can help you solve the problem, but you have to consider using System to take full control of ooxml. A Class Library such as Packaging. However, unfortunately, System. packaging only supports. NET 3.0 or later, now NPOI helps you solve this problem, NPOI still supports based on. NET 2.0 OOXML read/write, of course NPOI does not use System. packaging uses its own OOXML read/write library called OpenXML4Net. This library comes from POI's OpenXML4j. To respect the name of the original author, j is changed to Net.

The second surprise: everyone is looking forward to the Excel 2007/2010 read/write function. This is not very stable at present, and there will be some bugs, but most of the functions are available. It is worth mentioning that this NPOI. XSSF and NPOI. HSSF uses the same interface, that is, NPOI. old users of SS and NPOI once asked about NPOI. what is the significance of SS? Now you should understand that it is precisely because of the support of excel 2007 and excel 2010. Isn't interface-Oriented Programming and dependency injection popular now? NPOI. SS is a good practice. If you are interested, you can study the NPOI source code. Since the interfaces are basically consistent, the old users can easily use NPOI without additional learning. XSSF: Let's take a simple example. For example, create a Sheet, create a Cell, and assign a value to the Cell, such as Hello World.

Third surprise: More than 255 columns or 65535 rows are supported. That's right! Starting from 2.0, as long as you use XSSF, You can go beyond these two limits. In fact, I have already said that 255 columns or 65535 rows are not limited by NPOI. NPOI only deals with file formats. Theoretically, even versions earlier than NPOI 2.0, the record can also be written in, but the problem is that the Excel file does not buy an account and you write it into it. It does not necessarily make sense to read it. However, when Excel 2007 reads xlsx, it will process more than that, so it can help you export more data, which is a feature of xlsx format.

Fourth surprise: Word2007 support. Although NPOI's support for Word2003 has been in the "preliminary stage", HWPF has been placed in the scrathpad directory rather than the main directory, and has never been released with the official version, this time, we decided to add docx support to the official version. Of course, the Word support may not be as comprehensive as Excel. After all, Word and Powerpoint are not its strengths for POI, they are just getting started.

 

Speaking of this, are you a little impatient? If yes, you can download it at: http://npoi.codeplex.com/releases/view/92382.

However, the current NPOI version is still alpha. We hope you will use and give more comments in the spirit of dog food-food. We also welcome you to discuss business consulting and cooperation with me, my mailbox is tonyqus (at) gmail.com.

This article is from the "Tony Qu" blog, please be sure to keep this source http://tonyqus.blog.51cto.com/2676222/1128075

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.