March 16, 2011 at 10:38 am
Is it possible to set the properties of report objects such that they display on screen but not on printed output?
I have some reports whose formats must match that of a given data submission form when printed, but on screen I need a 'command button' to display a sub-report on demand. I can simulate a command button by manipulating the properties of a text box, and it's action property can trigger the sub-report, but is it possible to suppress it being printed?
Tony
August 5, 2011 at 8:38 am
I have just found the solution (in a free Microsoft eBook "Microsoft_Press_ebook_Introducing_Microsoft_SQL_Server_2008_R2"#.:-#
To quote from the book... "The expression language in SQL Server 2008 R2 Reporting Services includes a new global variable that allows you to set the values for “look-and-feel” properties based on the rendering format used to produce the report. That is, any property that controls appearance (such
as Color) or behavior (such as Hidden) can use members of the RenderFormat global variable
in conditional expressions to change the property values dynamically, depending on the
rendering format"
So in my example, I locate the hidden property of my text box (shown as Visibility in the property sheet), and set the value to the following...
=NOT(Globals!RenderFormat.IsInteractive)
This works because the print renderer and all the export renderers (except Web Archive, MHTML) set the RenderFormat.IsInteractive property to False.
An alternative would be to use this syntax...
=NOT(Globals!.RenderFormat.Name<>'RPL')
... which would also hide the text box in the MHTML render.
Note in the examples in the book omit the Globals! key word, and I couldn't make it work without it. Also, the book examples used an iif() construct, which is not needed as the output of the expressions are already boolean.
Tony
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply