水晶报表:有没有办法在水晶报表中进行正则表达式? [英] Crystal reports: is there a way to regex in crystal reports?
问题描述
我有一个水晶报表功能,它要求我删除以-"开头的字符并删除-"(破折号)后面的其余字符.
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).
例如,我的订单号是 00000112345-C43-PJ.
For example, I would have order number 00000112345-C43-PJ.
如何将-"右侧的所有内容都剪掉,得到结果为 00000112345?
How would I just trim off everything from the right of the "-" get the result as 00000112345?
我寻找了一个正则表达式和子字符串,但水晶似乎没有这些功能可用.
I looked for a regex and substring but crystal doesn't seem to have these functions available.
推荐答案
Crystal 可能没有正则表达式,但它肯定有所有基本的字符串函数
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)
这篇关于水晶报表:有没有办法在水晶报表中进行正则表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!