Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 3.74 KB

File metadata and controls

56 lines (42 loc) · 3.74 KB
title Constants in expressions in paginated reports
description Learn about the literal text or predefined text of constants in expressions for your paginated reports in Report Builder.
ms.date 09/25/2024
ms.service reporting-services
ms.subservice report-design
ms.topic concept-article
ms.custom
updatefrequency5

Constants in expressions in paginated reports (Report Builder)

[!INCLUDEssrs-appliesto] [!INCLUDE ssrs-appliesto-ssrs-rb] [!INCLUDE ssrs-appliesto-pbi-rb] [!INCLUDE ssrb-applies-to-ssdt-yes]

A constant in a paginated report consists of literal text or predefined text. The report processor has access to predefined constants so that when you include them in an expression, the values they represent are substituted in the expression before it is evaluated.

Note

[!INCLUDEssRBRDDup]

Literal Text

In an expression, literal text is text that is in double quotation marks. You can also type text directly into a text box without double quotation marks if it is not part of an expression. If the text box value does not begin with an equal sign (=), the text is treated as literal text. The following table shows several examples of literal text in an expression.

Constant Display text Expression text
Report run at: <<Expr>> ="Report run at: " & Globals!ExecutionTime
Adventure Works Cycles Adventure Works Cycles Adventure Works Cycles
[Bracketed display text] \[Bracketed display text\] [Bracketed display text]

RDL Constants

You can use constants defined in Report Definition Language (RDL) in an expression. In the Expression dialog box, constants appear when you create an expression for a report property that only accepts certain valid values, also known as enumerated types. The following table shows two examples.

Property Description Values
TextAlign Valid values for aligning text in a text box. General, Left, Center, Right
BorderStyle Valid values for a line added to a report. Default, None, Dotted, Dashed, Solid, Double, DashDot, DashDotdot

Visual Basic Constants

You can use constants defined in the [!INCLUDEvisual-basic] run-time library in an expression. For example, you can use the constant DateInterval.Day. The following expression for the date January 10, 2008 returns the number 10:

=DatePart("d",Globals!ExecutionTime)

CLR Constants

You can use constants defined in [!INCLUDEdnprdnshort] common language run-time (CLR) classes in an expression. The following table shows an example of a system-defined color.

Constant Description
MistyRose When you create an expression for a report property that is based on background color, you can specify a color by name. Valid names are listed in the Expression dialog box.

Related content