I am converting a crystal report to SSRS reports, I am having trouble converting two of the formulas for my report that I have tried a few ways and a third formula that I have no clue where to even begin in converting it.
Formula 1:
Shared NumPulls() as number
dim strval as string
dim pos as number
strval = cstr(NumPulls(1))
pos = InStr(strval,".")
strval = Left(strval,pos-1)
formula = strval
What I have tried below so far isn't working and I know it isn't even close probably, the first strvals are the errors in each:
1.) =InStr(strval asString, strval = cstr(NumPulls(1)), pos = InStr(strval, "."), strval = Left(strval, pos-1))
2.) =IIf(strval = cstr(NumPulls(1)), IIf(pos = InStr(strval,"."), strval = Left(strval,pos-1), 0, 0))
Formula 2:
Shared CustTotal() as number
dim strval as string
strval = cstr(CustTotal(1))
formula = strval
Here is what I have tried so far, the first strval is where the error is, it doesn't like this:
=InStr(strval as String, strval = cstr(CustTotal(1)))
Formula 3:
I have no clue how to begin converting this to SSRS from Crystal; any help would be greatly appreciated!
Shared WC81() as numberdim Values81 as string
dim x as number
dim strval as string
for x = 1 to 14
strval = cstr(WC81(x))
if x = 1 then
if len(strval) = 4 then
Values81 = Values81 & space(4) & strval
else
Values81 = Values81 & space(4-len(strval)+3) & strval
end if
elseif x = 14 then
if Len(strval) = 4 then
Values81 = Values81 & space(12) & strval
else
if len(strval) = 5 then
Values81 = Values81 & space(12-len(strval)+3) & strval
else
Values81 = Values81 & space(12-len(strval)+2) & strval
end if
end if
else
if x = 13 then
if len(strval) > 9 then
Values81 = Values81 & space(5-len(strval)+9)
else
Values81 = Values81 & space(5)
end if
end if
select case Len(strval)
case 1
Values81 = Values81 & space(18) & strval
case 2
Values81 = Values81 & space(16) & strval
case 3
Values81 = Values81 & space(14) & strval
case 4
Values81 = Values81 & space(12) & strval
case 5
Values81 = Values81 & space(10) & strval
case 6
Values81 = Values81 & space(8) & strval
case 7
Values81 = Values81 & space(6) & strval
case 8
Values81 = Values81 & space(5) & strval
case 9
Values81 = Values81 & space(3) & strval
case 10
Values81 = Values81 & space(2) & strval
case 11
Values81 = Values81 & space(1) & strval
case 12
Values81 = Values81 & space(1) & strval
case else
Values81 = Values81 & strval
end select
end if
next x
formula = Values81
Thanks in advance for any help that can be provided.
-Nicole