none
SSRS Data Scope Error for Visible Rectangle

    Question

  • Hi all

    I have a rectangle which a conditional visibility expression.  It's labelled:

    =IIF(SUM((Fields!PartyType.Value, "spPartyList") LIKE "TP%",1,0) < 1, True, False)

    Everytime I run the report however, I am presented with the error attached.

    Can anyone tell me as to why this is happening please?

    Thanks in advance.

    Monday, October 07, 2013 10:19 AM

Answers

  • Hi divvyboy,

    According to your description, it seems that you want to set the visibility of a rectangle based on the sum of the value of PartyType field, the value which first two letters are TP. After testing the expression which you posted in my own environment, I find that there are three questions exist in it.

    • The Like function used in Reporting Service with ‘*’, not’%’, so we can modify it to: like "TP*".
    • The scope of Aggregate function should be broader than the object which you used the function.
    • We should use iif function in the sum function to calculate the sum of the value in the expression.

    So we can try to modify the expression to like below to achieve your requirement:
    =IIF(SUM(iif(Fields!PartyType.Value like "TP*",1,0),"DataSet_name") <1, True, False)

    If you have any more questions, please feel free to ask.

    Thanks,
    Katherine Xiong

    • Marked as answer by warnerrj79 Tuesday, October 08, 2013 8:47 AM
    Tuesday, October 08, 2013 7:08 AM

All replies

  • Hi divvyboy,

    According to your description, it seems that you want to set the visibility of a rectangle based on the sum of the value of PartyType field, the value which first two letters are TP. After testing the expression which you posted in my own environment, I find that there are three questions exist in it.

    • The Like function used in Reporting Service with ‘*’, not’%’, so we can modify it to: like "TP*".
    • The scope of Aggregate function should be broader than the object which you used the function.
    • We should use iif function in the sum function to calculate the sum of the value in the expression.

    So we can try to modify the expression to like below to achieve your requirement:
    =IIF(SUM(iif(Fields!PartyType.Value like "TP*",1,0),"DataSet_name") <1, True, False)

    If you have any more questions, please feel free to ask.

    Thanks,
    Katherine Xiong

    • Marked as answer by warnerrj79 Tuesday, October 08, 2013 8:47 AM
    Tuesday, October 08, 2013 7:08 AM
  • Hi Katherine.

    This seems to have done the trick - I can now preview the report.

    Many thanks for your help :)

    Tuesday, October 08, 2013 8:47 AM