Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting from Crystal to SSRS - Formula issue

Status
Not open for further replies.

Stewman

MIS
Jan 23, 2002
79
US
Hello,

I’m trying to convert a stat report from Crystal to SSRS. In crystal I use a formula to do the calculations.

This is the crystal expression.

if {TRAFFIC_DATE_SUMMARY.TYPE} in (["Sober Designated Drivers Contacted", "Total DRE Evaluations"]) then '*'
else if Sum ({TRAFFIC_DATE_SUMMARY.KOUNT}, {TRAFFIC_DATE_SUMMARY.TYPE}) = 0 then '*'
else totext(Sum({TRAFFIC_DATE_SUMMARY.KOUNT}, {TRAFFIC_DATE_SUMMARY.TYPE}),0,"")

This was my attempt in SSRS

=iif(Fields!Type.Value) in (["Sober Designated Drivers Contacted", "Total DRE Evaluations"]) then "*"
else iif Sum(Fields!Kount.Value), (Fields!Type.Value)) = 0 then "*"
else totext(Sum((Fields!Kount.Value), (Fields!Type.Value)),0,"")

I get the following error when running in SSRS. The value expression for the textrun "Kount.Paragraphs[0].TextRuns[0]' contains an error: [BC30516] Overload resolution failed because no accessible 'IIF' accepts this number of arguments.

Any help appreciated. I'm sorta new to SSRS and still learning my way.

 
Hi Stewman,
In SSRS you don't need the 'then' or 'else' text in a IIF statement.

example:

=iif(fields!type.value in ('firsttype','secondtype'), '*', iif(sum(fields!cost.value,"GroupingName")=0, '*', 'Elsevaluegoeshere'))

The first test is in blue, the result if true is in blue bolded, the second test is in green, the result of this test if true is in green bolded, the else statement if both the first test and second test are false is in red.

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top