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.
To add a label that is related to a data item
In the development environment, on the Tools menu, choose Object Designer.
In Object Designer, choose Report.
Select a report, and then choose the Design button.
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.
-
Select the Include Caption check box for a Column data type row to add a label for the column.
Compile and save the report.
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. 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.
To add a label that is not related to a data item
In the development environment, on the Tools menu, choose Object Designer.
In Object Designer, choose Report.
Select a report, and then choose the Design button.
In Report Dataset Designer, on the View menu, choose Labels.
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.
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. On the View menu, choose Properties.
If you have a multilanguage application, then in the Properties window, specify values for the CaptionML property.
Compile and save the report.
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. 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.