【问题标题】:Crystal Reports - Check for Lowercase or UppercaseCrystal Reports - 检查小写或大写
【发布时间】:2020-07-13 04:21:02
【问题描述】:

我需要标识一个同时具有小写和大写值的字段值,用于定义标志状态。如果小写值存在或为空,则需要查看,否则视为完成。

或者,如果是大写,则标记为已完成,然后我可以将其添加为公式以排除所有“不等于”已完成。

【问题讨论】:

    标签: crystal-reports report uppercase lowercase


    【解决方案1】:

    我在SAP forums上找到了一个解决方案,可以识别值是在小写值范围还是大写值范围之间。

    //对于大写值

    ascw({field})>=65 and ascw({field})<=90
    

    //对于小写值

    ascw({field})>=97 and ascw({field})<=122
    

    最终代码通过以下方式创建一个公式值,然后选择所有“不匹配”值

    if ascw({GACCENTRYD.MTC_0}) >=65 and ascw({GACCENTRYD.MTC_0}) <=90 then 'Matched' else
    if ascw({GACCENTRYD.MTC_0}) >=97 and ascw({GACCENTRYD.MTC_0}) <=122 then 'UnMatched' else
    'UnMatched'
    

    【讨论】:

      【解决方案2】:

      在 Crystal 中,转到文件、报告选项...

      关闭“数据库服务器不区分大小写”选项。
      然后,使用一个简单的表达式,例如:

      If Ucase({status}) = {status} Then "Completed" ELSE "Not Completed";
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-06-19
        • 1970-01-01
        • 1970-01-01
        • 2017-11-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多