public override object calculate() { int num = base.paramList.Count; for (int i = 0; i < num; i++) { ExpParse parse = (ExpParse)base.paramList[i]; if (parse == null) { throw new ReportError("case函数出现无效参数"); } if (i >= (num - 1)) { return(parse.calculate()); } object obj3 = ConvertTool.getValue(parse.calculate()); if (!(obj3 is bool)) { throw new ReportError("case函数参数类型不正确"); } if (obj3.Equals(true)) { ExpParse parse2 = (ExpParse)base.paramList[i + 1]; if (parse2 == null) { throw new ReportError("case函数出现无效参数"); } return(parse2.calculate()); } i++; } return(null); }
public override object calculate() { if (base.paramList.Count != 1) { throw new ReportError("取单元格显示值函数的参数个数应该为1"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("取单元格显示值函数的第1个参数应该是单元格"); } object obj2 = parse.calculate(); if (obj2 == null) { return(new StringBuilder("").ToString()); } if (!(obj2 is CSVar)) { throw new ReportError("取单元格显示值函数的第1个参数应该是单元格"); } CellExt ext = ((CSVar)obj2).getCell(); if (ext == null) { return(null); } return(ext.GetValue(true)); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("group函数参数列表为空"); } ExpParse select = (ExpParse)base.paramList[0]; ExpParse filter = null; ExpParse desc = null; if (base.paramList.Count > 1) { desc = (ExpParse)base.paramList[1]; if (((desc != null) && desc.ConstantExpression) && (desc.calculate() == null)) { desc = null; } } if (base.paramList.Count > 2) { filter = (ExpParse)base.paramList[2]; } ExpParse sort = null; if (base.paramList.Count > 3) { sort = (ExpParse)base.paramList[3]; } return(this.Group_0.group(select, desc, filter, sort)); }
public override object calculate() { if (base.paramList.Count != 2) { throw new ReportError("map函数参数数目应为2"); } ExpParse parse2 = (ExpParse)base.paramList[0]; ExpParse parse = (ExpParse)base.paramList[1]; if ((parse2 == null) || (parse == null)) { throw new ReportError("map函数参数为空"); } object obj7 = parse2.calculate(); object obj3 = parse.calculate(); if ((obj7 is ArrayList) && (obj3 is ArrayList)) { ArrayList list = (ArrayList)obj7; ArrayList list2 = (ArrayList)obj3; object obj6 = base.cs.Current.GetValue(false); for (int i = 0; i < list.Count; i++) { object obj5 = ConvertTool.getValue(list[i]); if (ConvertTool.equals(obj6, obj5) && (list2.Count > i)) { return(ConvertTool.getValue(list2[i])); } } } return(null); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("sum函数参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("sum函数出现无效参数"); } object obj3 = ConvertTool.getValue(parse.calculate()); double num2 = 0.0; if (!(obj3 is ArrayList)) { return(obj3); } ArrayList list = (ArrayList)obj3; for (int i = 0; i < list.Count; i++) { object o = ConvertTool.getSingleValue(list[i]); if (o != null) { num2 += ConvertTool.doubleValue(o); } } return(num2); }
public override object calculate() { SubReportList subRptList = base.cs.Env.SubRptList; if (subRptList == null) { throw new ReportError("当前报表没有引入子报表,不能进行子报表运算"); } if ((base.paramList.Count < 3) || (base.paramList.Count > 4)) { throw new ReportError("子报表运算函数的参数格式应为subreport(rpt, List1, List2) 或者 subreport(rpt, List1, List2,importOrEmbed)"); } ExpParse parse4 = (ExpParse)base.paramList[0]; if (parse4 == null) { throw new ReportError("子报表运算函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse4.calculate()); int num = 0; if (base.paramList.Count == 4) { ExpParse parse3 = (ExpParse)base.paramList[3]; if (parse3 == null) { throw new ReportError("子报表运算函数出现无效参数"); } object obj6 = ConvertTool.getValue(parse3.calculate()); try { num = (int)obj6; } catch (Exception) { num = 0; } } if (!(obj2 is string)) { throw new ReportError("子报表运算函数第一个参数应为引入的子报表名"); } string str = subRptList.getAddress((string)obj2); string str2 = subRptList.getType((string)obj2); ReportDefine define = this.method_0(str, str2); ExpParse parse = (ExpParse)base.paramList[1]; ExpParse parse2 = (ExpParse)base.paramList[2]; if ((parse != null) && (parse2 != null)) { object obj5 = ConvertTool.getValue(parse.calculate()); object obj4 = ConvertTool.getValue(parse2.calculate()); if ((obj5 is ArrayList) && (obj4 is ArrayList)) { return(this.method_1(define, (ArrayList)obj5, (ArrayList)obj4, num)); } return(this.method_1(define, null, null, num)); } return(this.method_1(define, null, null, num)); }
public override object calculate() { if (base.paramList.Count < 2) { throw new ReportError("afterdays函数参数数目应为2"); } ExpParse parse = (ExpParse)base.paramList[0]; ExpParse parse2 = (ExpParse)base.paramList[1]; object obj3 = ConvertTool.getValue(parse.calculate()); object o = ConvertTool.getValue(parse2.calculate()); if ((obj3 != null) && (o != null)) { if (obj3 is string) { obj3 = ConvertTool.parseDate((string)obj3); if (!(obj3 is DateTime)) { throw new ReportError(new StringBuilder("字符串").Append(obj3).Append("不能转换成日期").ToString().ToString()); } } if (!(obj3 is DateTime) || !ConvertTool.isNumber(o)) { throw new ReportError("afterdays函数参数类型不正确"); } long num = ((System.DateTime)obj3).Ticks; long num2 = (((ConvertTool.longValue(o) * 24) * 3600) * 1000) * 10000; return(new System.DateTime(num + num2)); } return(null); }
private ArrayList method_4(ExpParse expParse_0, ExpParse expParse_1) { if (DataSet.DEBUG) { CellExt1 cS = expParse_0.CS; if ((cS != null) && (cS.Current != null)) { if (cS.Current.Source == cS.Current) { Logger.info(cS.Current.SourceId.ToString().ToString() + "分组使用索引"); } } else { Logger.info("分组使用索引"); } } bool flag = false; if (expParse_1 != null) { object obj2 = ConvertTool.getValue(expParse_1.calculate()); if (!(obj2 is bool)) { throw new ReportError("group函数第2个参数应该为空或null或布尔型值"); } flag = (bool)obj2; } return(this.dataSet_0.Index.getGroups(this.btree_0, !flag)); }
public override object calculate() { if (base.paramList.Count < 3) { throw new ReportError("条件函数参数数目应为3"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("条件函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse.calculate()); if (!(obj2 is bool)) { throw new ReportError("条件函数参数1应为布尔值"); } if (obj2.Equals(true)) { ExpParse parse2 = (ExpParse)base.paramList[1]; if (parse2 == null) { throw new ReportError("条件函数出现无效参数"); } return(parse2.calculate()); } ExpParse parse3 = (ExpParse)base.paramList[2]; if (parse3 == null) { throw new ReportError("条件函数出现无效参数"); } return(parse3.calculate()); }
public Group filter(ExpParse exp) { if (exp == null) { return(this); } if (exp.ConstantExpression) { object obj2 = exp.calculate(); if ((obj2 is bool) && (bool)(obj2)) { return(this); } } Group group = (Group)base.MemberwiseClone(); group.bool_0 = false; if (exp.getFilters(group) == null) { group.method_0(exp); } else { group.method_1(exp); } group.btree_0 = null; return(group); }
public override object calculate() { if (base.paramList.Count < 2) { throw new ReportError("ifnull函数参数数目应为2"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("ifnull函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse.calculate()); if ((obj2 != null) && (obj2 != DBNull.Value)) { return(obj2); } ExpParse parse2 = (ExpParse)base.paramList[1]; if (parse2 != null) { return(ConvertTool.getValue(parse2.calculate())); } return(null); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("get函数参数列表为空"); } ExpParse exp = (ExpParse)base.paramList[0]; ExpParse parse2 = null; ExpParse desc = null; if (base.paramList.Count > 1) { desc = (ExpParse)base.paramList[1]; if (((desc != null) && desc.ConstantExpression) && (desc.calculate() == null)) { desc = null; } } if (base.paramList.Count > 2) { parse2 = (ExpParse)base.paramList[2]; } ExpParse sort = null; if (base.paramList.Count > 3) { sort = (ExpParse)base.paramList[3]; } Group group = base.ds.CurrentGroup.filter(parse2); if ((sort != null) || (desc != null)) { if (sort == null) { sort = exp; } group = group.sort(sort, desc); } group.evaulateRows(exp); ArrayList rows = group.Rows; if (rows.Count == 1) { return(rows[0]); } if (rows.Count != 0) { return(rows); } Row nullRow = base.ds.NullRow; base.ds.CurrentRow = nullRow; return(nullRow); }
public virtual bool test(ExpParse exp) { this.dataSet_0.CurrentRow = this; object obj2 = ConvertTool.getValue(exp.calculate()); if (!(obj2 is bool)) { throw new ReportError("行过滤条件应返回布尔值"); } return((bool)obj2); }
public ArrayList group(ExpParse select, ExpParse desc, ExpParse filter, ExpParse sort) { if ((filter != null) && filter.ConstantExpression) { object obj2 = filter.calculate(); if ((obj2 is bool) && (bool)(obj2)) { filter = null; } } if (((sort == null) && (filter == null)) && this.method_5(select)) { return(this.method_4(select, desc)); } return(this.method_3(select, desc, filter, sort)); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("first函数参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; ExpParse desc = null; if (base.paramList.Count > 1) { desc = (ExpParse)base.paramList[1]; } ExpParse exp = null; if (base.paramList.Count > 2) { exp = (ExpParse)base.paramList[2]; } ExpParse sort = null; if (base.paramList.Count > 3) { sort = (ExpParse)base.paramList[3]; } Group group = base.ds.CurrentGroup.filter(exp); if ((sort != null) || (desc != null)) { if (sort == null) { sort = parse; } group = group.sort(sort, desc); } if (group.RowCount <= 0) { return(null); } Row row = group.getRow(0); base.ds.CurrentRow = row; row.setValue(parse.calculate()); return(row); }
public override object calculate() { if (base.paramList.Count < 2) { throw new ReportError("likestr函数参数数目至少为2"); } object obj2 = ConvertTool.getValue(((ExpParse)base.paramList[0]).calculate()); if (obj2 != null) { if (!(obj2 is string)) { throw new ReportError("likestr函数的第一个参数应为字符串"); } object obj3 = ConvertTool.getValue(((ExpParse)base.paramList[1]).calculate()); if (obj3 == null) { return(false); } if (!(obj3 is string)) { throw new ReportError("likestr函数的第二个参数应为格式串"); } bool ifcase = false; if (base.paramList.Count >= 3) { ExpParse parse = (ExpParse)base.paramList[2]; if (parse != null) { object obj5 = ConvertTool.getValue(parse.calculate()); if (!(obj5 is bool)) { throw new ReportError("likestr函数的第三个参数应为布尔值"); } ifcase = (bool)obj5; } } if (!StringUtils.matches((string)obj2, (string)obj3, ifcase)) { return(false); } return(true); } return(false); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("get1函数参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; ExpParse filterExp = null; if (base.paramList.Count > 1) { filterExp = (ExpParse)base.paramList[1]; } Row row = base.ds.CurrentGroup.select1(filterExp); base.ds.CurrentRow = row; row.setValue(parse.calculate()); return(row); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("tostring函数参数为空"); } object o = ConvertTool.getValue(((ExpParse)base.paramList[0]).calculate()); if (base.paramList.Count > 1) { ExpParse parse2 = (ExpParse)base.paramList[1]; if (parse2 != null) { object obj3 = ConvertTool.getValue(parse2.calculate()); return(ConvertTool.format(o, (string)obj3)); } } return(ConvertTool.toString(o)); }
public override object calculate() { if (base.unit_0 == null) { throw new ReportError("单元格选择函数{}缺少左操作数"); } object obj4 = base.unit_0.calculate(); if (obj4 != null) { if (!(obj4 is CSVar)) { throw new ReportError("单元格选择函数{}的左操作数应为单元格"); } ArrayList list = ((CSVar)obj4).getCells(null); if (base.paramList.Count > 0) { ExpParse parse = (ExpParse)base.paramList[0]; base.cs.saveCurrent(); if (parse != null) { for (int i = 0; i < list.Count; i++) { CellExt ext = (CellExt)list[i]; base.cs.Current = ext; object obj3 = ConvertTool.getValue(parse.calculate()); if (!(obj3 is bool)) { throw new ReportError("单元格选择函数{}的条件参数应返回布尔值"); } if (obj3.Equals(false)) { list.RemoveAt(i--); } } } base.cs.resumeCurrent(); } return(list); } return(new ArrayList(0)); }
public Group sort(ExpParse sort, ExpParse desc) { if ((sort != null) && !sort.ConstantExpression) { object obj2 = null; if (desc != null) { object obj3 = ConvertTool.getValue(desc.calculate()); if (!(obj3 is bool)) { throw new ReportError("group函数第2个参数应该为空或null或布尔型值"); } obj2 = obj3; } Group group = (Group)base.MemberwiseClone(); group.method_2(sort, Convert.ToBoolean(obj2)); return(group); } return(this); }
public override object calculate() { ArrayList list = new ArrayList(); for (int i = 0; i < base.paramList.Count; i++) { ExpParse parse = (ExpParse)base.paramList[i]; object obj3 = null; if (parse != null) { obj3 = parse.calculate(); if (obj3 is CSVar) { obj3 = ((CSVar)obj3).getCells(null); } } this.addToList(obj3, list); } return(list); }
public override object calculate() { if (base.paramList.Count < 2) { throw new ReportError("days2date函数参数数目应为2"); } ExpParse parse = (ExpParse)base.paramList[0]; ExpParse parse2 = (ExpParse)base.paramList[1]; object obj2 = ConvertTool.getValue(parse.calculate()); object obj3 = ConvertTool.getValue(parse2.calculate()); if ((obj2 == null) || (obj3 == null)) { return(null); } if (obj2 is string) { obj2 = ConvertTool.parseDate((string)obj2); if (!(obj2 is DateTime)) { throw new ReportError(new StringBuilder("字符串").Append(obj2).Append("不能转换成日期").ToString().ToString()); } } if (obj3 is string) { obj3 = ConvertTool.parseDate((string)obj3); if (!(obj3 is DateTime)) { throw new ReportError(new StringBuilder("字符串").Append(obj3).Append("不能转换成日期").ToString().ToString()); } } if (!(obj2 is DateTime) || !(obj3 is DateTime)) { throw new ReportError("days2date函数参数类型不正确"); } long num = ((System.DateTime)obj2).Ticks; System.DateTime time2 = (System.DateTime)obj3; return(ConvertData.getInteger((int)((time2.Ticks - num) / 864000000000))); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("最小值函数参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("最小值函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse.calculate()); object obj3 = null; if (obj2 is ArrayList) { ArrayList list = (ArrayList)obj2; for (int i = 0; i < list.Count; i++) { object obj5 = ConvertTool.getSingleValue(list[i]); if (obj5 != null) { if (obj3 != null) { if (ConvertTool.compare(obj3, obj5) > 0) { obj3 = list[i]; } } else { obj3 = obj5; } } } return(obj3); } return(obj2); }
public override object calculate() { if (base.paramList.Count != 1) { throw new ReportError("fieldvalue函数的参数应该为1个"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("fieldvalue函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse.calculate()); if (!(obj2 is string)) { throw new ReportError("fieldvalue函数出现无效参数"); } string fieldName = (string)obj2; return(base.env.getEformFieldValue(fieldName)); }
public override object calculate() { int num = base.paramList.Count; if (num < 1) { throw new ReportError("sort函数参数个数至少有1个"); } ExpParse parse2 = (ExpParse)base.paramList[0]; if (parse2 == null) { throw new ReportError("sort函数的第1个参数应该为数组"); } object obj2 = parse2.calculate(); bool asc = true; if (num >= 2) { ExpParse parse = (ExpParse)base.paramList[1]; if (parse != null) { object obj4 = ConvertTool.getValue(parse.calculate()); if (!(obj4 is bool)) { throw new ReportError("sort函数的第2个参数应为布尔型"); } asc = (bool)obj4; } } if (!(obj2 is ArrayList)) { throw new ReportError("sort函数的第1个参数应为数组"); } ArrayList list = (ArrayList)obj2; SupportClass.CollectionsManager.Sort((IList)list, new Class11(this, asc)); return(list); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("count函数参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("count函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse.calculate()); if (!(obj2 is ArrayList)) { return(ConvertData.getInteger(0)); } ArrayList list = (ArrayList)obj2; return(ConvertData.getInteger(list.Count)); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("函数isempty参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse != null) { object obj2 = parse.calculate(); if (obj2 is ArrayList) { ArrayList list = (ArrayList)obj2; if (list.Count == 0) { return(true); } } } return(false); }
public override object calculate() { if (base.paramList.Count != 1) { throw new ReportError("getpubvalue函数的参数应该为1个"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("getpubvalue函数出现无效参数"); } object obj2 = ConvertTool.getValue(parse.calculate()); if (!(obj2 is string)) { throw new ReportError("getpubvalue函数出现无效参数"); } string sname = (string)obj2; return(EformRole.getPubParamValue(base.env.Session, sname)); }
public override object calculate() { if (base.paramList.Count == 0) { throw new ReportError("偏移函数参数列表为空"); } ExpParse parse = (ExpParse)base.paramList[0]; if (parse == null) { throw new ReportError("偏移函数出现无效参数"); } object obj4 = ConvertTool.getValue(parse.calculate()); if (!(obj4 is int)) { throw new ReportError("偏移函数参数应为正整数"); } int num = (int)obj4; if (base.unit_0 == null) { throw new ReportError("偏移函数[]左操作数为空"); } object o = base.unit_0.calculate(); if (!(o is ArrayList)) { throw new ReportError("偏移函数[]左操作数应为数组"); } ArrayList list = (ArrayList)ConvertTool.getValue(o); if ((num >= 1) && (num <= list.Count)) { return(list[num - 1]); } return(null); }
public object calculate(CellExt1 cs, DataSet ds, Env env, string param) { UnitSet set; this.cs = cs; this.ds = ds; this.env = env; ExpParse parse = new ExpParse(cs, ds, env, param); string str = (string)ConvertTool.getValue(parse.calculate()); if ((str != null) && (str.Trim().Length > 0)) { set = new UnitSet(Escape.removeEscAndQuote(str), true, '&'); } else { set = new UnitSet("", true, '&'); } CellExt current = cs.Current; StringBuilder sb = new StringBuilder(); object obj3 = null; try { obj3 = this.cal(set, sb); } catch (Exception exception) { throw new ReportError("统计图计算异常:" + exception.Message.ToString().ToString(), exception); } string str2 = sb.ToString(); if ((str2 != null) && (str2.Trim().Length > 0)) { current.setPropValue(0x131, str2); } return(obj3); }