Skip to main content

Field List (Visual Studio Report Designer)

  • 4 minutes to read

The Field List panel displays a tree view with data sources, available fields, calculated fields, and report parameters.

Field List

Right-click a node to invoke the context menu and select an action. The following image shows an action that allows you to add sqlDataSource1 to the Report Gallery and reuse it in other reports:

Field List - Add Data Source to Report Gallery

The Field List allows you to perform the following tasks:

Search Fields

Enter a string in the search field. The Field List filters fields and tables to match an input string.

Field List - Search

The Field List filters fields and tables only within the previously expanded nodes.

Bind Controls to Data

Drop a field onto the report surface to create a new report control bound to that field.

Field List - Drop Field Onto the Surface

Drop a field onto an existing report control to bind that control to the field.

Field List - Drop Field Onto a Control

Hold down the Ctrl key when you drop a field on top of an existing control to retain the control’s data binding settings. This action creates a new data-bound report control.

Field List - Drop Field Onto a Control and Keep Binding

Select the Type of Control to Create

To select the type of control when you create it, do one of the following:

  • Hold down the Shift key as you drop the data field onto the report surface.
  • Right-click a data field, and drag and drop it onto the report surface.

This action invokes a context menu where you can choose which control to create.

Field List - Select Which Control to Create

Create Tables

Drop an entire data table onto the report surface to create a table with columns bound to the data table fields.

Field List - Drop Table

Hold down the Ctrl key and select multiple data fields in the field list. Drag these fields onto the report to create a report table that contains only the selected fields.

Field List - Select Specific Fields

If you hold down the Shift key or right-click the fields, and then drag the selected fields to the report surface, a new table is created with cells that display the names of the selected fields.

Field List - Create Column Headers

Add Calculated Fields

You can add calculated fields to the data source.

Field List - Add Calculated Field

Add Report Parameters

You can add report parameters or change existing parameters.

Field List - Add Report Parameter

Display Date-Time Value Components (Years, Months, Days, Hours, and so on)

If you need to display a date-time value component, you no longer need to specify a format string or use expression functions. The Field List window now allows you to expand date-time fields and see available components. You can drag and drop these components onto existing controls to establish new data bindings or place them on the report surface to create new data-bound controls.

win report designer field list - show date-time components

Set the ShowFieldListDateTimeComponents property to true, so the Field List displays date-time components for DateTime, DateOnly, and TimeOnly fields:

DateOnly
Day, Month, Year
DateTime
Day, Month, Year, Hour, Minute, Second
TimeOnly
Hour, Minute, Second

You can do it at application startup or in the Visual Studio Report Designer settings window.

This functionality supports two modes. Use the DateTimeComponentBindingMode property to switch between modes. When a field is dropped from the Field List, the Report Designer automatically creates an expression binding and does one of the following:

Format String

Example: {0:%d}, {0:%M}

Applies a format string to field values according to the selected date-time component. This mode is useful for displaying formatted date or time values in a report.

win-date-time-component-binding-mode-format-string

Expression

Example: GetDay, GetMonth

Assigns an expression function when you add a field component from the Field List or use a field component in the Expression Editor. You can further refine expressions in the Expression Editor. This mode is most useful when you need to combine data from multiple data source fields.

win-date-time-component-binding-mode-expression

See the class description for information on how to set designer options in code: UserDesignerOptions.