Share via


How to: Create Labels for a Report

When you create a client report definition (RDLC) report layout in Visual Studio, you add data items from the Visual Studio dataset to the layout. If you want to add a label to the report layout, such as a caption for a field, a title for a chart, or a title for the report, then you must have a label in the Visual Studio dataset. You add labels to the dataset with Report Dataset Designer. You can either add labels that are related to another data item, such as the caption for a table field, or labels that are not related to another data item, such as the title of the report.

  1. In the development environment, on the Tools menu, choose Object Designer.

  2. In Object Designer, choose Report.

  3. Select a report, and then choose the Design button.

  4. In Report Dataset Designer, do one of the following:

    • Select the Include Caption check box for a Column data type row to add a label for the column.

    • Select a Column data type row for which you want to add a label to the dataset, and on the View menu, choose Properties. In the Properties window, set the IncludeCaption property to Yes.

  5. Compile and save the report.

  6. On the View menu, choose Layout.

    The RDLC layout opens in Visual Studio. The captions that you included are available in the Report Data pane in Visual Studio, under Parameters.

    Note

    To view the Report Data pane, in Visual Studio, on the View menu, choose Report Data.

  7. Drag the captions from the parameters list to the layout to add labels to the report. The caption that is used is the value of the Caption property from the field in the table.

  1. In the development environment, on the Tools menu, choose Object Designer.

  2. In Object Designer, choose Report.

  3. Select a report, and then choose the Design button.

  4. In Report Dataset Designer, on the View menu, choose Labels.

  5. In Report Label Designer, in the Name field, add a Common Language Specification (CLS)–compliant name for the label. This name is used in the Visual Studio dataset. For more information, see the "Naming" section in Common Language Specification in the MSDN Library.

  6. In the Caption field, enter the caption.

    Note

    The default language of the caption depends on the current language of the development environment. For more information, see Caption Property.

  7. On the View menu, choose Properties.

  8. If you have a multilanguage application, then in the Properties window, specify values for the CaptionML property.

  9. Compile and save the report.

  10. On the View menu, choose Layout.

    The RDLC layout opens in Visual Studio. The captions that you added are available in the Report Data pane in Visual Studio, under Parameters.

    Note

    To view the Report Data pane, in Visual Studio, on the View menu, choose Report Data.

  11. Drag the captions from the parameters list to the layout to add labels to the report.

    Note

    The language of the label that is displayed when you run the report depends on the language setting of the report object. For more information, see Multiple Document Languages and Viewing the Application in Different Languages.

See Also

Tasks

How to: Create RDLC Reports

Reference

IncludeCaption Property
CaptionML Property
Caption Property

Concepts

Designing, Running, and Printing Reports