From d2713dced7d238913526a90fab781f1c40f5955e Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 31 Mar 2020 18:08:12 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-28351=20=E5=BC=BA=E8=BD=AC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/template/info/JWorkBookProcessInfo.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index eec7773282..85266b7cd8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -5,6 +5,7 @@ import com.fr.main.impl.WorkBook; import com.fr.main.parameter.ReportParameterAttr; import com.fr.report.cellcase.CellCase; import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.report.Report; import com.fr.report.worksheet.WorkSheet; import java.util.Iterator; @@ -61,8 +62,12 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { int blockCount = 0; if (!template.isElementCaseBook()) { // 如果是聚合报表 for (int i = 0; i < template.getReportCount(); i++) { - PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); - blockCount += r.getBlockCount(); + Report report = template.getReport(i); + // 考虑多个sheet下 包含WorkSheet的情况 需要判断下 + if (report instanceof PolyWorkSheet) { + PolyWorkSheet r = (PolyWorkSheet) report; + blockCount += r.getBlockCount(); + } } } return blockCount;