Placeholders for SSRS Expressions

How could I have missed it?! Only recently did I discover the placeholder concept in  Microsoft SQL Server Reporting Services (SSRS).

In the report design interface, a text box containing an expression more complex than a single field reference (e.g. [FirstName]) or single field aggregate function call (e.g. [Count(Orders)]) is displayed as <<Expr>>.

Open a report containing multiple <<Expr>> text boxes and try to remember what each contains. Ouch! Want to apply different formatting to part of the text rendered by an <<Expr>> text box? No go. Stylistic settings cannot be applied to individual elements of the <<Expr>>.

Enter the Placeholder

Placeholders allow you to insert an expression as a component inside a text box. A placeholder may be given a friendly name. Its output may be formatted separately from the containing text box’s other contents.

In the example to the right, the text box contains a placeholder and plain text. Instead of being displayed as <<Expr>>, the placeholder’s friendly name identifies what it represents. Also notice how the placeholder is styled differently than the surrounding text.

To get started using placeholders, click inside a text box as though you were going to edit the box’s text, then right-click and choose Create Placeholder.

 

 

One thought on “Placeholders for SSRS Expressions

  1. KevinOfDundas

    <blockquote cite="Want to apply different formatting to part of the text rendered by an <> text box? No go. Stylistic settings cannot be applied to individual elements of the <>.”>

    So I get around this by making it an HTML placeholder. You can fully format the text using HTML tags, so I pass in a formatted piece of HTML code.

    Reply

Leave a Reply to KevinOfDundas Cancel reply

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