SSRS: Referencing Data Contained in Other Textboxes

Did you know that the content of other textboxes can be referenced in Microsoft SQL Server Reporting Services expressions?

In the example below, the expression for Destination (the lower textbox) is set to =ReportItems!Source.Value. When report rendering occurs, Destination is populated with Source‘s content.

The ability to retrieve other textboxes’ values becomes particularly useful in table controls when the results of a complex computation needs to be used multiple times.

Example: for each data set row, we might want to output a numerical value derived from a complex expression followed by a data bar graphically displaying the same numerical value. Without the ability to reference other textboxes’ contents, both the the textbox and the data bar would have to be configured with the same complex expression. By using ReportItems, we can simplify the definition of the data bar by telling it to pull its value from the preceding textbox (e.g. =ReportItems!NumericalValue.Value).


Leave a Reply

Your email address will not be published. Required fields are marked *