diff --git a/bin/com/connor/cust/box/BoxReportOperation$1.class b/bin/com/connor/cust/box/BoxReportOperation$1.class index 0742cbb..909c9b3 100644 Binary files a/bin/com/connor/cust/box/BoxReportOperation$1.class and b/bin/com/connor/cust/box/BoxReportOperation$1.class differ diff --git a/bin/com/connor/cust/box/BoxReportOperation.class b/bin/com/connor/cust/box/BoxReportOperation.class index 2a6e934..aa213f6 100644 Binary files a/bin/com/connor/cust/box/BoxReportOperation.class and b/bin/com/connor/cust/box/BoxReportOperation.class differ diff --git a/bin/com/connor/cust/util/POIUtil.class b/bin/com/connor/cust/util/POIUtil.class index c0325a0..ecbcc67 100644 Binary files a/bin/com/connor/cust/util/POIUtil.class and b/bin/com/connor/cust/util/POIUtil.class differ diff --git a/src/com/connor/cust/box/BoxReportOperation.java b/src/com/connor/cust/box/BoxReportOperation.java index 1b9f2f3..6dc4ea4 100644 --- a/src/com/connor/cust/box/BoxReportOperation.java +++ b/src/com/connor/cust/box/BoxReportOperation.java @@ -42,10 +42,10 @@ public class BoxReportOperation extends AbstractAIFOperation { private LinkedList datas; private HashMap boxMap; - private final int PAGE_CNT = 23;// - private final int TITLE_CNT = 4; - private final int PAGE = PAGE_CNT + TITLE_CNT; - private final int COL_CNT = 9; + private final int PAGE_CNT = 23;//每页内容行数 + private final int TITLE_CNT = 4;//每页表头行数 + private final int PAGE = PAGE_CNT + TITLE_CNT;//每页总行数 + private final int COL_CNT = 9;//每页最大列号 /** * 装箱单报表 * @param session TCSession @@ -114,10 +114,11 @@ public class BoxReportOperation extends AbstractAIFOperation { if(b % PAGE_CNT > 0) pageCnt ++; } - for(int i=1; i<=pageCnt; i++) { -// sheet.copyRows(0, PAGE, i*PAGE, null); - POIUtil.copyRows(workbook, sheet, 0, PAGE-1, i*PAGE, COL_CNT, 1); - } +// for(int i=1; i<=pageCnt; i++) { +//// sheet.copyRows(0, PAGE, i*PAGE, null); +// POIUtil.copyRows(workbook, sheet, 0, PAGE-1, i*PAGE, COL_CNT, 1); +// } + POIUtil.copyRows(workbook, sheet, 0, PAGE-1, PAGE, COL_CNT, pageCnt - 1); int row = 0, rbox = 0, pbox = 0; for(String[] data : datas) { int box = Integer.parseInt(data[COL_CNT]); @@ -131,7 +132,7 @@ public class BoxReportOperation extends AbstractAIFOperation { rbox = 1; pbox = box; - xssfrow = TCUtil.getRow(sheet, page * PAGE + 1); + xssfrow = TCUtil.getRow(sheet, page * PAGE); cell = TCUtil.getCell(xssfrow, 5); String[] boxno = PlmLocale.getString("boxno").split(";"); cell.setCellValue(boxno[0] + getNumStr(box) + boxno[1]); diff --git a/src/com/connor/cust/util/POIUtil.java b/src/com/connor/cust/util/POIUtil.java index 8518e61..7e08890 100644 --- a/src/com/connor/cust/util/POIUtil.java +++ b/src/com/connor/cust/util/POIUtil.java @@ -506,9 +506,11 @@ public class POIUtil { XSSFCell targetCell = null; short m; sourceRow = getRow(sheet, i); - for (int j = 1; j <= copyCount; j++) { - int space = (endRow - startRow + 1 + margin) * j; - targetRow = sheet.createRow(i + space); + for (int j = 0; j < copyCount; j++) { +// int space = (endRow - startRow + 1 + margin) * j; +// targetRow = sheet.createRow(i + space); + int space = (endRow - startRow + 1) * j + margin; + targetRow = getRow(sheet, i - startRow + space); targetRow.setHeight(sourceRow.getHeight()); for (m = sourceRow.getFirstCellNum(); m <= endCol; m++) { if(m < 0) @@ -548,8 +550,8 @@ public class POIUtil { } } - for (int j = 1; j <= copyCount; j++) { - int space = (endRow - startRow + 1 + margin) * j; + for (int j = 0; j < copyCount; j++) { + int space = margin + (endRow - startRow + 1) * j - startRow; for (int n = 0; n < regionCnt; n++) { region = sheet.getMergedRegion(n); if ((region.getFirstColumn() >= startRow) && (region.getLastRow() <= endRow) && (region.getLastColumn() <= endCol)) {