水晶报表:有没有办法在regex的水晶报表? [英] crystal reports : is there a way to regex in crystal reports?

查看:151
本文介绍了水晶报表:有没有办法在regex的水晶报表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个水晶报表功能,它要求我剪除以 - 开头的字符,并删除 - (破折号)后的其余字符。



例如..我会有订单号00000112345-C43-PJ



从 - 到右边的所有内容,并得到结果00000112345



我寻找一个正则表达式和子字符串,但cr似乎没有这些功能可用。
提前感谢

解决方案

Crystal可能没有正则表达式,但肯定有所有基本的字符串函数



  Left( {OrderNumber},InStr({OrderNumber}, - ) -  1)


I have a crystal report function which requires me to trim off characters which start with a "-" and delete the rest following the the "-" (dash).

for example.. I would have order number 00000112345-C43-PJ

how would I just trim off everything from the "-" and to the right and get the result 00000112345

I looked for a regex and substring but cr doesn't seem to have these functions available. thanks in advance

解决方案

Crystal might not have regex but it certainly has all the basic string functions

Something like this should do it for you (not tested):

Left({OrderNumber}, InStr({OrderNumber}, "-") - 1) 

这篇关于水晶报表:有没有办法在regex的水晶报表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆