用水晶报表中的预定义变量替换子串 [英] replacing substring with predefined variable in crystal reports
本文介绍了用水晶报表中的预定义变量替换子串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<< / b>嗨
我在面对一个问题水晶报告时定义自定义公式
示例
如果我定义了
x1 =一
x2 =两个
。
。
。
a = '21'
b =x+左(a,1)+仅
如果我打印字符串b结果是 x1
我怎么得到'one only'如果我打印字符串b因为x1 =one
伙计们请帮助
谢谢提前
<</b>Hi
I am facing a problem crystal reportwhen defining custom formula in
example
if i have defined
x1="one"
x2="two"
.
.
.
a='21'
b="x"+left(a,1)+" only"
if i print string b the result is x1 only
how do i get 'one only' if i print string b since x1="one"
guys plz help
thanks in advance
推荐答案
我建议使用x的数组来保存one,two等等
所以你会有
x [0] =一
x [1] =两个
。
。
。
所以当你打印b
的值为b
b = x [Convert.ToInt32(left(a,1))-1] +only; //索引超出范围检查
I would suggest using an array of x to save "one", "two" and so on
so then you would have
x[0] = "one"
x[1] = "two"
.
.
.
so when you print b
have value of b as
b = x[Convert.ToInt32(left(a, 1)) -1] + " only"; //index out of range checks
这篇关于用水晶报表中的预定义变量替换子串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文