【二开插件】报表过滤条件原创
金蝶云社区-zlz
zlz
4人赞赏了该文章 815次浏览 未经作者许可,禁止转载编辑于2023年05月12日 13:43:35

报表的过滤条件可以分为快捷过滤和条件过滤

图片.png

  • 快捷过滤

 DynamicObject customFilter = filter.FilterParameter.CustomFilter;
 string orgs = customFilter["SettleOrgLst"].GetString();


  • 条件过滤

    1. 获取比较符号和值

    2. 去掉部分过滤条件(替换成1=1)

            var rows = filter.FilterParameter.FilterRows;
            foreach (var row in rows)
            {
                string FieldName = row.FilterField.FieldName;
                if (FieldName == "F_swaw_RKYWLX")
                {
                    operate = row.CompareType.Operate;
                    value = row.Value;
                    break;
                }
            }
            string filterString = filter.FilterParameter.FilterString;
            int index = filterString.IndexOf("F_swaw_RKYWLX");
            if (index > -1)
            {
                int index1 = filterString.IndexOf("'", index);
                int index2 = filterString.IndexOf("'", index1 + 1);
                if (index2 > -1)
                {

                    filter.FilterParameter.FilterString= filterString.Replace(filterString.Substring(index, index2 - index + 1), "1=1");
                }


附:条件过滤数据包

图片.png

          }


赞 4