Share via


Adding a Text Box

A text box is a report item that contains an expression. This expression can contain static text, point to a field in the database, or calculate data.

To view instructions about working with text boxes, see:

The following table provides examples of expressions that you can use in a text box. For static text, you can also simply enter the text directly into the text box using no expression (no equal sign or quotes.)

Expression Description

="This is static text"

Displays a static text label.

=Fields!UnitCost.Value

Displays the value of the UnitCost field.

=Fields!TotalUnits.Value * Fields!UnitCost.Value

Multiplies the value of the TotalUnits field and the UnitCost field and displays the result.

=Sum(Fields!TotalUnits.Value)

Calculates the sum of the TotalUnits field across all rows in the group.

Growing and Shrinking a Text Box

By default, text boxes are a static size. If you want to expand a text box vertically based on its contents, change the CanGrow property for the text box. If you want to allow the text box to shrink based on its contents, change the CanShrink property for the text box. You can access these properties through the Properties window or through the Textbox Properties dialog box.

See Also

Concepts

Working With Fields in a Report Dataset

Other Resources

Using Expressions in Reporting Services
Textbox Properties (General Tab, Report Designer)

Help and Information

Getting SQL Server 2005 Assistance