Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Crystal (is working fine)
MIDL
if isnull({rptTrainingBillingInfo.OrderPrice}) then
(
    if isnull({rptTrainingBillingInfo.BillingRecordPrice}) then
        {rptTrainingBillingInfo.ItemPrice}
    else
        {rptTrainingBillingInfo.BillingRecordPrice}
)
else
(
    {rptTrainingBillingInfo.OrderPrice}
)


Reporting Services
VB
=IIF (IsNothing(Fields!OrderPrice.Value),
 IIF (IsNothing(Fields!BillingRecordPrice.Value), Fields!ItemPrice.Value, Fields!BillingRecordPrice.Value),
 Fields!OrderPrice.Value)



For some strange reason, the second IIF in SSRS when evaluating is given 0 always!

if I just evaluate the second IIF, I get a value
IIF (IsNothing(Fields!BillingRecordPrice.Value),Fields!ItemPrice.Value, Fields!BillingRecordPrice.Value)

But if I nested both IFF I don't.

Any idea? Thanks
Posted
Updated 22-Jun-11 3:40am
v3

1 solution

I think that Fields!OrderPriceNatural.Value is the problem.
If evaluation in the first IIF statement fails, then you also see the wrong results: Fields!BillingRecordPriceNatural.Value (=0) instead of the evaluation of the second IIF statement.

Does the Fields!OrderPriceNatural.Value exist, does it have a value?

Try this statement to see if the first IIF statement is causing the problem:
=IIF (IsNothing(Fields!OrderPriceNatural.Value), 1, 2)


If you see 2 where you expected 1 then the problem is not caused by the nested IIF.
 
Share this answer
 
v2
Comments
luisnike19 22-Jun-11 9:38am    
Thanks for the reply, noup the first IIF is not the problem, when OrderPriceNatural.Value is not null it always print the correct value, in this case 2 or Fields!OrderPriceNatural.Value.
When is Null (or IsNothing) always 0.
[no name] 22-Jun-11 15:43pm    
I would try this:
1) test the query for null/empty string values
2) print the values of Fields!OrderPrice.Value, Fields!BillingRecordPrice.Value, Fields!ItemPrice.Value, the second IIF statement and the original nested IIF statement in a new textbox.
3) Recreate the report and see if this solves the problem

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