【问题标题】:crystal report formula to check character structure matches用于检查字符结构匹配的水晶报告公式
【发布时间】:2012-08-04 01:46:23
【问题描述】:

我正在尝试查看是否有一个公式可以检查字符串字段类型中是否使用了某个字符结构 我需要检查它是否匹配,如果不匹配则使用变红。

字母 ALPAH NUM NUM NUM NUM 字母

AA123A - 好的,
A1234A - 变红。

提前致谢。

【问题讨论】:

    标签: crystal-reports formula


    【解决方案1】:

    尝试使用类似的东西作为条件格式公式:

    local stringvar somefield:={table.string_field};
    
    if len(somefield)=7
        and ascw(somefield[1]) in [65 to 90]
        and ascw(somefield[2]) in [65 to 90] 
        and isnumeric(somefield[3 to 5])
        and ascw(somefield[6]) in [65 to 90] then crBlack else crRed

    显然,这仅适用于大写字母字符(ASCII 值 65-90),但可以轻松更改以适应您的需要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-20
      相关资源
      最近更新 更多