public virtual void replaceMacros(IDictionary macros) { if ((macros != null) && (macros.Count != 0)) { ShortMap propGetMap = ExpMap.PropGetMap; if (propGetMap != null) { object obj2 = propGetMap[302]; if (obj2 is string) { string text = (string)obj2; propGetMap.put(302, MacroCalc.replaceMacros(text, macros)); } } string expStr = ExpMap.ExpStr; if (expStr != null) { ExpMap.ExpStr = MacroCalc.replaceMacros(expStr, macros); } ShortMap propEngMap = ExpMap.PropEngMap; if (propEngMap != null) { for (int i = 0; i < propEngMap.size(); i++) { ExpParseInfo expInfo = (ExpParseInfo)propEngMap.getValue(i); expInfo.ExpStr = MacroCalc.replaceMacros(expInfo.ExpStr, macros); } } } }
public virtual void calcProperties() { ShortMap propEngMap = ExpMap.PropEngMap; if (propEngMap != null) { if (row != null) { row.DataSet.CurrentRow = row; } for (int i = 0; i < propEngMap.size(); i++) { short key = propEngMap.getKey(i); if ((key != 304) && (key != 305)) { var expInfo = (ExpParseInfo)propEngMap.getValue(i); setPropResult(key, ConvertTool.getSingleValue(expInfo.Exp.calculate())); } } } }
public virtual void prepareCalculate() { try { int_4 = 0; if (ExpMap.ExpStr != null) { if (!PropertyDefine.CEX_DEFAULT.Equals(Extensible)) { ExpMap.Exp = new ExpParse(CellSet, ExpMap.ExpStr); // bool flag1 = !PropertyDefine.CEX_HORIZONTAL.Equals(Extensible) ? PropertyDefine.CEX_VERTICAL.Equals(Extensible) : true; } else { ExpMap.Exp = new ExpParse(CellSet, ExpMap.ExpStr, true); CellExt ext = CellSet.getCell(0, 0); if (ExpMap.Exp.Extended) { if ((prevCell == ext) && (nextCell != ext)) { Extensible = PropertyDefine.CEX_HORIZONTAL; } else if ((prevCell != ext) && (nextCell != ext)) { Extensible = PropertyDefine.CEX_NONE; } else { Extensible = PropertyDefine.CEX_VERTICAL; } } } object_1 = originObject; } else { ShortMap propGetMap = ExpMap.PropGetMap; if (propGetMap != null) { object_1 = propGetMap[302]; object obj2 = propGetMap[301]; if (((object_1 != null) && ((obj2 == null) || obj2.Equals(PropertyDefine.CDT_TEXT))) && (object_1 is string)) { object_1 = ConvertTool.parse((string)object_1, false); if (propGetMap[305] == null) { //string s = (string) propGetMap[304]; //if (!StringUtils.isSpaceString(s)) //{ propGetMap.put(305, ConvertTool.format(object_1, "{0}"));//s)); //} } } } } ShortMap propEngMap = ExpMap.PropEngMap; if (propEngMap != null) { for (int i = 0; i < propEngMap.size(); i++) { ExpParseInfo expInfo = (ExpParseInfo)propEngMap.getValue(i); expInfo.Exp = new ExpParse(CellSet, expInfo.ExpStr); } } } catch (ReportError error) { error.CellId = SourceId; throw error; } catch (Exception exception) { throw new ReportError(new StringBuilder("单元格").Append(SourceId).Append("中有错误,").Append(exception.Message).ToString().ToString(), exception); } }