Interview Questions

Thursday, June 29, 2017

Using Simple Expressions in SSRS

Simple expressions appear on the design surface and in dialog boxes in brackets, for example, a dataset field appears as [ProductID]. Simple expressions are created for you automatically when you drag a field from a dataset onto a text box. A placeholder is created and the expression defines the underlying value. You can also type expressions directly into a data region cell or text box, both on the design surface or in a dialog box, (for example, [ProductID]).
The following table lists examples of the ways you can use simple expressions. The table describes the functionality, the property to set, the dialog box you typically use to set it, and the value for the property. You can type the simple expression directly on the design surface, in a dialog box, or in the Properties pane, or you can edit it in the Expression dialog box, just as you would with any expression.
FunctionalityProperty, Context, and Dialog BoxProperty Value
Specify a dataset field to display in a text box.Value property for a placeholder inside a text box. Use Placeholder Properties Dialog Box, General.[Sales]
Aggregate values for a group.Value property for a placeholder inside a row associated with a tablix group. Use Textbox Properties Dialog Box.[Sum(Sales)]
Include a page number.Value property for a placeholder inside a text box that is placed in a page header. Use Textbox Properties Dialog Box, General.[&PageNumber]
Display a selected parameter value.Value property for a placeholder inside a text box on the design surface. Use Textbox Properties Dialog Box, General.[@SalesThreshold]
Specify a group definition for a data region.Group expression on the tablix group. Use Tablix Group Properties Dialog Box, General.[Category]
Exclude a specific field value from a table.Filter equation on the tablix. Use Tablix Properties Dialog Box, Filters.For data type, select Integer.

[Quantity]

>

100
Include only a specific value for a group filter.Filter equation on the tablix group. Use Tablix Group Properties Dialog Box, Filters.[Category]

=

Clothing
Exclude specific values for more than one field from a dataset.Filter equation for a group in a tablix. Use Tablix Properties Dialog Box, Filters.=[Color]

<>

Red

=[Color]

<>

Blue
Specify sort order based on an existing field in a table.Sort expression on the tablix. Use Tablix Properties Dialog Box, Sorting.[SizeSortOrder]
Link a query parameter to a report parameter.Parameters collection on the dataset. Use Dataset Properties Dialog Box, Parameters.[@Category]

[@Category]
Pass a parameter from a main report to a subreport.Parameters collection on the subreport. Use Subreport Properties Dialog Box, Parameters.[@Category]

[@Category]

No comments:

Post a Comment