How do I evaluate the toggle state of a textbox within an expression?
Hi! On a Reporting Services 2005 report, I have a table with a single group row and a single detail row (and about 5 columns). The details are set up to toggle visibility based ona textbox in the group header called "txt_Order_Number". The order line item details are set with their initial visibility set as hidden. So, when you click on the Plus sign next to the Order Number, the detail rows display below. However, what I'd like to do ischange the background color of the toggled group header row when it is toggled and the details are displayed. Here's what's going on . . . The row with the Order header information has every textbox set in bold. That's good. It makes a subtle distinction between the order detail rows and the order header row, so when you're looking at the dollar amountson each line item and trying toadd them up in your head to seewhether they correctly add up to the dollar amount in the order header row, you can at least more easily see the total amount. However, it makes the whole overall report look funny because all of the order header information is in bold. What I really want to do is change the background color of the order header row to light gray or some other subtle color and change the font to Bold when the details are toggled to visible in order to distinguish that row as the header row. In order to do this, I think I somehow need to get to a certain element of the Reporting Services object model called "Textbox.ToggleState". If I can get to that piece of the puzzle in an expression or even in code within the report, that should tell me the state of the textbox's toggle switch and I should be able to use that information to conditionally set the color of the textbox.(or every textbox in the row probably.) Here's all I could find out about this on TechNet http://technet.microsoft.com/en-us/library/microsoft.reportingservices.reportrendering.textbox.togglestate.aspx I just can't figure out how to get to that piece of information in a Reporting Servicesexpression or in the report's code block. Any suggestions? I'd appreciate a response even if it's "You can't do that." Actually, the best response someone might be able to provide might be alink to a sampleshowing how to getto any of the textbox properties like that. Thanks!Karen
April 10th, 2008 11:38pm

You can't do that. Once the report generated, it's impossible to dynamically change item properties.
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2008 12:15am

HiGrgory Thanks for answering . . . How is this different from any other conditional formatting? I'm sorry, but I really don't understand. If I can change the color of text based on a condition or conditionally suppress a detail row, why can't I change the row background color based on the toggle state when the textbox is toggled? If it's just not possible, then how is textbox.togglestate used? Is is only used to set the initial toggle state programmatically? I'm really confused. Clearly, an event is fired when you toggle a textbox. The screen gets refreshed. I don't understand why I can't conditionally color a row based on the toggle state of a text box. Please help me understand - or guide to a place that explains how that textbox property is used. Thanks! Karen
April 11th, 2008 6:36am

Okay . . . I've done a bit more research, and it sounds as though at least up to about 9 months ago, the ToggleState wasn't exposed as a property you could test or check within an expression. There was lots of negative feedback about that. Can anyone tell me if this has been resolved in RS 2008? I about to begin testing, and it would be good to know if I'd be wasting my time trying this in 2008. Please let me know. Thanks!Karen
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2008 6:56am

Karen, did you ever find a way of doing this? I need to do the same thing with row colors. I want to alternate colors and how I do that depends on whether a group of rows is visible or not. I'm using 2008 R1.Thanks,Steve
December 5th, 2009 6:34pm

Karen, did you ever find a way of doing this? I need to do the same thing with row colors. I want to alternate colors and how I do that depends on whether a group of rows is visible or not. I'm using 2008 R1.Thanks,Steve Steve,Did you ever come up with a solution to this?
Free Windows Admin Tool Kit Click here and download it now
January 4th, 2010 8:09pm

I have the same problem as Karen. Has anybody figured it out yet?
June 30th, 2010 3:23pm

having same problem...
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2010 5:37pm

I need to do this too, is there really no way?
May 19th, 2011 1:21am

Hard to believe we can't detect this at run time.... Yet another shortcoming of SSRS...
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 5:46pm

I too need this !! is there any work around at least ! :(
July 7th, 2011 6:03pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics