Crystal报表:是否可以在Crystal报表中进行正则表达式? [英] Crystal reports: is there a way to regex in crystal reports?

查看:61
本文介绍了Crystal报表:是否可以在Crystal报表中进行正则表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

我正在寻找正则表达式和子字符串,但crystal似乎没有这些可用的函数。

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) 

这篇关于Crystal报表:是否可以在Crystal报表中进行正则表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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