Posted on 2009-02-14
Last Modified: 2012-05-06
Hi ,
I have added following Expression in one of cell of my rdlc but i am getting an error.
=iif(  (ReportItems!textbox43.Value <> "N/A") AND (ReportItems!textbox46.Value <> "N/A"),(((1+ReportItems!textbox43.Value)/100)/((1+ReportItems!textbox46.Value)/100)-1),"0.00%")

If i remove the formula from the expression above,it works good,can any one tell me how to make above expression work.
Basically the logic is If ReportItems!textbox43.Value & ReportItems!textbox46.Value is not equal to N/A then (((1+ReportItems!textbox43.Value)/100)/((1+ReportItems!textbox46.Value)/100)-1) else 0.00%
Can any one help ASAP.
Question by:aspnetdev
    LVL 11

    Expert Comment

    Hi.. could you tell us what the error message is and which part of the expression works? Looking at the formulae as it stands, you have the correct number of brackets and the structure of the IIF statement is correct.

    Author Comment

    i get this #error and if i replace following parameter in IIF condition
    with something like "This is a test",it works.
    LVL 11

    Expert Comment

    Try replacing



    it could be that the values in texbox43 and 46 might not be numbers even though they look like numbers and hence it cant do the calculations.


    Author Comment

    You are correct shorak,actually the equation is becoming N/A/100 and hence no calculation can be done.Anyways i tried
    =iif(  (ReportItems!textbox43.Value <> "N/A") AND (ReportItems!textbox46.Value <> "N/A"),((cint(1+ReportItems!textbox43.Value)/100)/((1+cint(ReportItems!textbox46.Value))/100)-1),"0.00%")

    i still get #error.Can you help me more.

    Author Comment

    and i tried this too....

    i still get #Error.

    LVL 11

    Accepted Solution

    Do the contents of textbox43 and texbox46 always say 'N/A' when its not a number or can they say something else too?

    We also need to make sure that textbox43 and texbox46 are both numeric.
    Are textbox43 and texbox46 are part of a table row? If so, then add 2 extra columns at the end and put the following expressions in each one:
    1st column

    2nd column

    These two columns will tell us if the values in the two texboxes are numbers or not.. if they are then they both will say "True" (apart from when the two fields say 'N/A').
    If you dont have a table then just create two textboxes and put the same expressions in each box. Both should say true. If so, then delete the extra columns/textboxes you just created. If you get 'False' when  textbox43 and texbox46 dont say 'N/A', then there is an issue with the data type.

    Also it might be worth testing out each part of your rexpression. First, try the following expressions and see if you get an error..

    =IIF (ReportItems!textbox43.Value <> "N/A" AND ReportItems!textbox46.Value <> "N/A","OK","Not OK")

    = IIF (ReportItems!textbox43.Value <> "N/A" AND ReportItems!textbox46.Value <> "N/A",(cint(ReportItems!textbox43.Value)+1)/100,"0.00%")

    = IIF (ReportItems!textbox43.Value <> "N/A" AND ReportItems!textbox46.Value <> "N/A",
    ((cint(­ReportItem­s!textbox4­6.Value)+1­)/100)-1 ,"0.00%")


    = IIF (ReportItems!textbox43.Value <> "N/A" AND ReportItems!textbox46.Value <> "N/A",
     ((cint(ReportItems!textbox43.Value)+1)/100)/(((cint(­ReportItem­s!textbox4­6.Value)+1­)/100)-1) ,"0.00%")

    The code snipet below should hopefully work for you.


    = IIF(ReportItems!textbox43.Value <> "N/A" AND ReportItems!textbox46.Value <> "N/A",
    ((cint(ReportItems!textbox43.Value)+1)/100)/(((cint(ReportItems!textbox46.Value)+1)/100)-1) ,"0.00%")

    Open in new window


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now