Use poi to parse Excel getlastnum ()

Source: Internet
Author: User

Yesterday, when I used poi to parse the Excel file, I found that if the Excel file is encrypted, that is, the Excel file is set to protected worksheet (tool --> Protection Work Sheet) the poi of apahce cannot parse the encrypted Excel file. However, if only one sheet in the encrypted Excel file (that is, the sheet protected by the Excel file is set to protected) can be parsed ~~~

In addition, poi provides a method to obtain the maximum number of rows, which is called getlastrownxx. The number of rows obtained by getlastrownxx is the number of rows of the unit rows drawn in your Excel file.

If you have 10 rows of data in the Excel file, call this method and return 10,

After you manually delete two rows using Delete, call this method and return 10. In this case, you need to delete the unit rows before returning 8 ~~~

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.