diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index ca5f030dd6..77074ab96f 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -102,6 +102,7 @@ import java.io.Reader; import java.io.StringReader; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -787,9 +788,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { return scanner.getUnSupportFormula(); } - UnsupportedSimulationFormulaHunter unsupportedSimulationFormulaHunter = new UnsupportedSimulationFormulaHunter(); + UnsupportedSimulationNodeHunter unsupportedSimulationFormulaHunter = new UnsupportedSimulationNodeHunter(); expression.traversal4Tiny(unsupportedSimulationFormulaHunter); - return unsupportedSimulationFormulaHunter.isSupported() ? null : unsupportedSimulationFormulaHunter.getUnSupportFormula(); + return unsupportedSimulationFormulaHunter.isSupported() ? null : unsupportedSimulationFormulaHunter.getUnSupportedNode(); } catch (Exception e) { FineLoggerFactory.getLogger().error("", e); } @@ -869,25 +870,30 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } } - private static class UnsupportedSimulationFormulaHunter extends TinyHunter { - + private static class UnsupportedSimulationNodeHunter extends TinyHunter { private boolean supported = true; - private String unSupportFormula; + private String unSupportedNode; + + private String[] curReportVariables; + + public UnsupportedSimulationNodeHunter() { + curReportVariables = VariableResolver.DEFAULT.resolveCurReportVariables(); + } public boolean isSupported() { return supported; } - public String getUnSupportFormula() { - return unSupportFormula; + public String getUnSupportedNode() { + return unSupportedNode; } public void hunter4Tiny(Tiny tiny) { - if (tiny.getClass() == ColumnRowRangeInPage.class) { + if (tiny.getClass() == ColumnRowRangeInPage.class || Arrays.asList(curReportVariables).contains(tiny.toString())) { supported = false; - unSupportFormula = tiny.toString(); + unSupportedNode = tiny.toString(); } } }