The ' to ' row (0) must isn't being less than the ' from ' Row (1)

Source: Internet
Author: User

1. Error description

Exception in thread "main" Java.lang.IllegalArgumentException:The ' to ' row (0) must not is less than than the ' from ' Row (1) at Org.apache.poi.hssf.model.InternalSheet.addMergedRegion (internalsheet.java:513) at Org.apache.poi.hssf.usermodel.HSSFSheet.addMergedRegion (hssfsheet.java:680) at Com.you.excel.ThreeHead.main ( threehead.java:130)

2. Cause of error

region Region1 = new Region (0, (short) 0, 2, (short) 0); Region Region2 = new Region (0, (short) 1, 0, (short) 6); Region Region3 = new Region (0, (short) 7, 0, (short) 12); Region Region4 = new Region (0, (short) of 0, (short) 18); Region Region5 = new Region (1, (short) 1, 0, (short) 3); Region Region6 = new Region (0, (short) 4, 0, (short) 6); Region region7 = new Region (0, (short) 7, 0, (short) 9); Region Region8 = new Region (0, (short), 0, (short) 12); Region Region9 = new Region (0, (short) of 0, (short) 15); Region Region10 = new Region (0, (short): 0, (short) 18); Sheet.addmergedregion (Region1); Sheet.addmergedregion (Region2); Sheet.addmergedregion (Region3); Sheet.addmergedregion (REGION4); Sheet.addmergedregion (REGION5); Sheet.addmergedregion (REGION6); Sheet.addmergedregion (region7); Sheet.addmergedregion (REGION8); Sheet.addmergedregion (REGION9); 

Region(int rowFrom, short colFrom, int rowTo, short colTo)

Rowfrom is smaller than rowto or equal to


3. Solutions



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The ' to ' row (0) must isn't being less than the ' from ' Row (1)

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.