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)