Line 1... |
Line 1... |
1 |
/*
|
1 |
/*
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
3 |
*
|
3 |
*
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
4 |
* Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
|
5 |
*
|
5 |
*
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
9 |
* language governing permissions and limitations under the License.
|
9 |
* language governing permissions and limitations under the License.
|
Line 69... |
Line 69... |
69 |
|
69 |
|
70 |
if (colEnd > 0) {
|
70 |
if (colEnd > 0) {
|
71 |
System.err.println("Set Column Count to :: " + (colEnd + 1));
|
71 |
System.err.println("Set Column Count to :: " + (colEnd + 1));
|
72 |
sheet.setColumnCount(colEnd + 1);
|
72 |
sheet.setColumnCount(colEnd + 1);
|
73 |
}
|
73 |
}
|
- |
|
74 |
if (this.nbPage < 1) {
|
- |
|
75 |
throw new IllegalArgumentException("invalid page count : " + this.nbPage);
|
- |
|
76 |
}
|
74 |
sheet.duplicateFirstRows(this.nbRowsPerPage, this.nbPage);
|
77 |
sheet.duplicateFirstRows(this.nbRowsPerPage, this.nbPage - 1);
|
75 |
|
78 |
|
76 |
Object printRangeObj = sheet.getPrintRanges();
|
79 |
Object printRangeObj = sheet.getPrintRanges();
|
77 |
if (printRangeObj != null) {
|
80 |
if (printRangeObj != null) {
|
78 |
String[] range2 = printRangeObj.toString().split(":");
|
81 |
String[] range2 = printRangeObj.toString().split(":");
|
79 |
|
82 |
|
80 |
for (int i = 0; i < range2.length; i++) {
|
83 |
for (int i = 0; i < range2.length; i++) {
|
81 |
String string = range2[i];
|
84 |
String string = range2[i];
|
82 |
range2[i] = string.subSequence(string.indexOf('.') + 1, string.length()).toString();
|
85 |
range2[i] = string.subSequence(string.indexOf('.') + 1, string.length()).toString();
|
83 |
}
|
86 |
}
|
84 |
|
87 |
|
85 |
int end = -1;
|
- |
|
86 |
if (range2.length > 1) {
|
88 |
if (range2.length > 1) {
|
87 |
end = sheet.resolveHint(range2[1]).y + 1;
|
89 |
int end = sheet.resolveHint(range2[1]).y + 1;
|
88 |
long rowEndNew = end * (this.nbPage + 1);
|
90 |
int rowEndNew = end * this.nbPage;
|
89 |
String sNew = s.replaceAll(String.valueOf(end), String.valueOf(rowEndNew));
|
91 |
String sNew = s.replaceAll(String.valueOf(end), String.valueOf(rowEndNew));
|
90 |
sheet.setPrintRanges(sNew);
|
92 |
sheet.setPrintRanges(sNew);
|
91 |
System.err.println(" ****** Replace print ranges; Old:" + end + "--" + s + " New:" + rowEndNew + "--" + sNew);
|
93 |
System.err.println("SpreadSheetGenerator ****** Replace print ranges; Old:" + end + "--" + s + " New:" + rowEndNew + "--" + sNew);
|
92 |
}
|
94 |
}
|
93 |
} else {
|
95 |
} else {
|
94 |
sheet.removePrintRanges();
|
96 |
sheet.removePrintRanges();
|
95 |
}
|
97 |
}
|
96 |
|
98 |
|