Click here to Skip to main content
15,920,670 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<</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
Posted
Updated 4-Jul-13 22:32pm
v4
Comments
PRADEaZX 8-Jul-13 6:21am    
Thanks Samresh it worked

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900