Changing a value based on a ToggleState

Posted by: nlcandyman on 3 August 2017, 3:23 pm EST

  • Posted 3 August 2017, 3:23 pm EST

    Is it in any way possible to change the value of a textbox based on the InitialToggleState of another textbox?



    For example:



    I have TextBox1 on row 1 in table with a toggle.

    On the same row of the table, i have TextBox2 that contains a normal text value.



    Is it in any way possible to change the value of TextBox2 based on the InitialToggleState of TextBox1?

    So if the ToggleState of TextBox1 is "Collapsed" i want it to show "Count" and when the Togglestate is "Expanded" i want it to show "TotalCount"



    I tried a few IIF things like; =IIF( ReportItems!TextBox1.ToggleState ="Collapsed","Total","TotalCount") and =IIF( ReportItems!TextBox1.InitialToggleState ="Collapsed","Total","TotalCount") but they don't seem to work.



    Any help would be greatly appreciated.



    Thanks in Advance.
  • Replied 3 August 2017, 3:23 pm EST

    Hello,

    The Hidden property of TextBox can be used to get the initial toggle state of TextBox. However this does not seems to be working when used in an expression. Since Data Dynamics Reports has been put in maintenance mode, there are no further bug fixes provided for it.

    However, the same behavior was reproduced with ActiveReports7 which is the latest version of the product. I have reported the issue with ActiveReports7 and the bug number for the same is 170505. I would let you know as soon as I get any information in this regard.

    Thanks,
    Manpreet Kaur
  • Replied 3 August 2017, 3:23 pm EST

    Hello,

    According to the development team the issue reported in bug number 170505 is a design behavior and it would not be possible to use the Hidden property to change the text for the textbox.

    As a workaround you can use two TextBoxes in the same column with alternate visibility properties to get the desired results.

    1). Set the following properties for the first Textbox(TextBox3):
    Value = "Count", Visibility.Hidden = False, ToggleItem = TextBox1



    2). Set the following properties for the second TextBox(TextBox4):
    Value = "TotalCount", Visibility.Hidden = True, ToggleItem = TextBox1

    So, Textbox3 is initially visible and TextBox4 is hidden, so when TextBox1 is expanded then Textbox3 becomes hidden and TextBox4 becomes visible. And, when TextBox1 is collapsed then Textbox4 becomes hidden and TextBox3 becomes visible.

    Please have a look at the attached report that implements the suggested workaround. You may bind the report to Northwind database to get it working.

    Hope it helps.

    Thanks,
    Manpreet Kaur

    2013/06/ToggleVisibiltyReport.rdlx
  • Replied 3 August 2017, 3:23 pm EST

    Hello,

    Data Dynamics Reports is now a legacy product. ActiveReports7 provides you a better way to achieve the desired behavior. It allows yo to place two controls at the same location with the help of the container report item. Since, you can place the controls one over the other it gives the user an illusion that a single textbox is being used to display two different values.

    You may refer to the attached report that implements the same. You can use the suggested workaround in case you wish to upgrade to ActiveReports7.

    Thanks,
    Manpreet Kaur

    2013/07/ToggleVisibilitty2.rdlx
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels