locked
Expressen code to make hide/show for a textbox RRS feed

  • Question

  • Goal:
    Show the textbox with value "Sound list" and "test" if Title and Time set to "show".

    The textbox with value "Title_a" act as a toogle to show/hide for the value of "Title" and Time


    Problem:
    I don't know how to write expressen code for the textbox "Sound list" and "test" to hide/ show. If "Title" and "Time" is set to hide, the "soundlist" and "test" will also be hidden.

    // Fullmetalboy

    Tuesday, February 7, 2012 11:23 AM

Answers

  • Hi Fullmetalboy,

    you can have toggleitem (let say Textbox A) to show/hide Rows, this works with Rows and Columns. For values in in each individual textboxes you can write code to left tem blank or to populate different data, based on some conditions (expressions). You can set your toggleitem to show or hide Rows based on expression too.

    Assuming from your screen shoot, you set Row visibility property on row where you have lables Title and Time (second row) and set Title_a textbox to betoggleitem. And when you run report this two are hidden, but you still see Sound list and Test, right?

    If this is the case, then just set on all rows that you want to hide same toogle item - Title_a and set them to be hidden at initual run, this should function.

    if this is not your case, plase provide me with additional info.

    Regards


    • Edited by Ursa Pangos Tuesday, February 7, 2012 2:00 PM
    • Proposed as answer by Ursa Pangos Thursday, February 9, 2012 9:38 AM
    • Marked as answer by Elvis Long Thursday, February 16, 2012 9:16 AM
    Tuesday, February 7, 2012 12:52 PM
  • Hi Fullmetalboy,

    From your description, you want to add atoggle on the “Title_a” item to control the visibilities of the “Tile”, ”Time”, “Sound list” and “test” textboxes at the same time. If I have misunderstood you, please feel free to correct me.

    In this case, please follow these steps to achieve the target:

    1. Click anywhere in the table region to display the table handles, right-click the row handle for the “Title” row (the third row) and select “Row Visibility”.
    2. In the Row Visibility dialog box, select “Hide”.
    3. Select “the Display Can Be Toggled By This Report Item” check box, and then select the “Title_a” field in the drop down list. Click OK.
    4. Repeat the previous three steps to hide the “Sound list” row (the second row), using the same Toggled item,
    “Title_a”.

    For more information about Row Visibility, please see:
    How to: Add a Visibility Toggle to an Item (Reporting Services)

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

    Thanks,
    Mike Yin

    • Edited by Mike Yin Friday, February 10, 2012 1:43 AM
    • Proposed as answer by Elvis Long Tuesday, February 14, 2012 5:14 AM
    • Marked as answer by Elvis Long Thursday, February 16, 2012 9:16 AM
    Thursday, February 9, 2012 9:33 AM

All replies

  • Hi Fullmetalboy,

    you can have toggleitem (let say Textbox A) to show/hide Rows, this works with Rows and Columns. For values in in each individual textboxes you can write code to left tem blank or to populate different data, based on some conditions (expressions). You can set your toggleitem to show or hide Rows based on expression too.

    Assuming from your screen shoot, you set Row visibility property on row where you have lables Title and Time (second row) and set Title_a textbox to betoggleitem. And when you run report this two are hidden, but you still see Sound list and Test, right?

    If this is the case, then just set on all rows that you want to hide same toogle item - Title_a and set them to be hidden at initual run, this should function.

    if this is not your case, plase provide me with additional info.

    Regards


    • Edited by Ursa Pangos Tuesday, February 7, 2012 2:00 PM
    • Proposed as answer by Ursa Pangos Thursday, February 9, 2012 9:38 AM
    • Marked as answer by Elvis Long Thursday, February 16, 2012 9:16 AM
    Tuesday, February 7, 2012 12:52 PM
  • Hi Fullmetalboy,

    From your description, you want to add atoggle on the “Title_a” item to control the visibilities of the “Tile”, ”Time”, “Sound list” and “test” textboxes at the same time. If I have misunderstood you, please feel free to correct me.

    In this case, please follow these steps to achieve the target:

    1. Click anywhere in the table region to display the table handles, right-click the row handle for the “Title” row (the third row) and select “Row Visibility”.
    2. In the Row Visibility dialog box, select “Hide”.
    3. Select “the Display Can Be Toggled By This Report Item” check box, and then select the “Title_a” field in the drop down list. Click OK.
    4. Repeat the previous three steps to hide the “Sound list” row (the second row), using the same Toggled item,
    “Title_a”.

    For more information about Row Visibility, please see:
    How to: Add a Visibility Toggle to an Item (Reporting Services)

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

    Thanks,
    Mike Yin

    • Edited by Mike Yin Friday, February 10, 2012 1:43 AM
    • Proposed as answer by Elvis Long Tuesday, February 14, 2012 5:14 AM
    • Marked as answer by Elvis Long Thursday, February 16, 2012 9:16 AM
    Thursday, February 9, 2012 9:33 AM