Work with report labels

Completed

Labels are used to add text fields to the parameters of a report. Typically, these text fields are text strings that you need to use on reports that are not coming from the database, such as the title of the report or other custom text values that you require.

You can add labels to the dataset. Labels can be related to a data item, such as the caption for a table field. Labels can be unrelated to a data item, such as the title of the report.

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 dataset.

The advantage of using labels is that labels will be added to the translation file so that they can become multilingual. If you hard-code text values in your report and add these values into variables in the dataset to become available in the layout, then these hard-coded text strings will not become available in the translation file and will not be considered multilingual.

Labels become available in the parameters of the layout, so they have a positive impact on performance because the labels aren't added to the dataset of the report.

Report labels are used by RDL and Word report layouts as, for example, the caption for a field, the title for a chart, or the title for the report itself.

Report labels are defined inside the labels control of a report object, as shown in the following code sample.

al-languageCopy
labels
{
  LabelName1 = 'Label Text1', Comment='Foo', MaxLength=999, Locked=true;
  LabelName2 = 'Label Text2', Comment='Foo', Locked=false;
} 

The more fields that are added to the dataset, the bigger it becomes and the higher the impact will be on the report performance.