Problems Using Expressions to control the Visibility ToggleItem (SSRS 2005)

  • Hi, I have a problem I am hoping someone out there knows the answer to.

    I have a report with up to 9 levels of Grouping in the table, and a detail section. Depending on the data the used the report may use any number of Groups (1-9). I want to change the Visibilty ToggleItem on the Detail section to a textbox in whichever is the lowest grouping level being used...

    I have the following Expression in the ToggleItem property:

    =IIF(FIRST(Fields!GROUP9_HEADER_FLG.Value)="Y",textbox133,=IIF(FIRST(Fields!GROUP8_HEADER_FLG.Value)="Y",textbox117,=IIF(FIRST(Fields!GROUP7_HEADER_FLG.Value)="Y",textbox101,=IIF(FIRST(Fields!GROUP6_HEADER_FLG.Value)="Y",textbox61,=IIF(FIRST(Fields!GROUP5_HEADER_FLG.Value)="Y",textbox85,=IIF(FIRST(Fields!GROUP4_HEADER_FLG.Value)="Y",textbox69,=IIF(FIRST(Fields!GROUP3_HEADER_FLG.Value)="Y",textbox165,=IIF(FIRST(Fields!GROUP2_HEADER_FLG.Value)="Y",textbox48,textbox5))))))))

    But I am receiving the following error:

    Error1[rsInvalidToggleItem] The table ‘table1’ has ‘=IIF(FIRST(Fields!GROUP9_HEADER_FLG.Value)="Y",textbox133,=IIF(FIRST(Fields!GROUP8_HEADER_FLG.Value)="Y",textbox117,=IIF(FIRST(Fields!GROUP7_HEADER_FLG.Value)="Y",textbox101,=IIF(FIRST(Fields!GROUP6_HEADER_FLG.Value)="Y",textbox61,=IIF(FIRST(Fields!GROUP5_HEADER_FLG.Value)="Y",textbox85,=IIF(FIRST(Fields!GROUP4_HEADER_FLG.Value)="Y",textbox69,=IIF(FIRST(Fields!GROUP3_HEADER_FLG.Value)="Y",textbox165,=IIF(FIRST(Fields!GROUP2_HEADER_FLG.Value)="Y",textbox48,textbox5))))))))’ as a toggle item. Toggle items must be text boxes that share the same scope as the hidden item or are in a scope that contains the hidden item, and cannot be contained within the current report item unless current grouping scope has a Parent.

    I don't know if I am doing it wrong, or if its just not possible. Can someone give me some pointers?

    Thanks

    David

  • Is the textbox you are using a part of the report that groups the detail that you are trying to hide or make visible? The error would indicated that it is not, and that it should be.

  • Yes, the textboxes in the Expression are part of the report...

    They are nested groups... if GROUP9 isn't being used I want it to remain Hidden, and use a textbox from GROUP8 to toggle the visibility of the Detail section.. if GROUP8 also isn't being used, then move up to GROUP7, etc until I find the inner-most nested group that is being used.

  • Hi Dave:

    I have a similar problem. I want to set the "ToggleItem" property of the detail row to an expression, but it appears that SSRS 2005 is truly taking any text supplied in the ToggleItem property as a textbox name, and doesn't bother to process the expression as an actual expression. So, any expression that is typed into the ToggleItem property will fail since no textbox has a name that looks like an expression.

    To highlight my specific situation, I have a parameter where a user can either group by "company" or group by "manager". If a user selects to group by "Company", then I want the ToggleItem of the detail row to be toggled by a textbox in the group header called "GroupName_1": i.e. the report groups by Company, and a user can then toggle to the details to see the managers for a specific company. If a user selects to group by "manager", however, then I want the detail row to remain hidden without any mechanism to toggle its visibility since the managers' data is now at the group level.

    Bottom line: I don't think it's possible to supply an expression in the detail row's ToggleItem property since SSRS will take any text supplied in the property as a textbox name.

    If someone knows a way around this, please share.

    --Pete

  • I have the same problem. Can someone help please.

  • I have got this to work by setting the visibility on a textbox component on my report which is used to show a total for the column, using an expression based on one of my parameters. Next, I set the Visibility.ToggleItem on the column to the textbox name.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply