【问题标题】:DevExpress XtraReport: boolean filterDevExpress XtraReport:布尔过滤器
【发布时间】:2014-10-31 12:19:40
【问题描述】:

我正在使用 devexpress 和 xtrareport 工具。

我做了一个带有布尔参数的过滤器,以这种方式定义:

this.FilterString = "[ABILITATO] = ?abilitatoParam";

它可以工作,但是...如果我想查看 ABILITATO 设置为 true 的记录,我点击 True 和相同的 fo False。但是如果我想查看所有记录,不过滤?

【问题讨论】:

    标签: c# filter boolean devexpress xtrareport


    【解决方案1】:

    使用字符串过滤器完成。

    我使用事件参数请求提交。然后我检查参数并设置我想要的值:

    if (e.ParametersInformation[0].Parameter.Value.ToString() == Application.Current.FindResource("Abilitati").ToString())
        e.ParametersInformation[0].Parameter.Value = "True";
    else if (e.ParametersInformation[0].Parameter.Value.ToString() == Application.Current.FindResource("Disabilitati").ToString())
        e.ParametersInformation[0].Parameter.Value = "False";
    else if (e.ParametersInformation[0].Parameter.Value.ToString() == Application.Current.FindResource("Tutti").ToString())
         e.ParametersInformation[0].Parameter.Value = string.Empty;
    

    这是过滤字符串:

    "Contains([ABILITATO], ?abilitatoP)"
    

    【讨论】:

      【解决方案2】:

      我认为filterstring 中的Iff 条件是可能的。首先,您必须创建一个计算字段并使用您的过滤器集设置Iff 条件。 将计算字段作为主字段。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-09-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-07-28
        • 1970-01-01
        相关资源
        最近更新 更多