New to Telerik Reporting? Download free 30-day trial

Setting a No Data Message to Data Items

The No Data Message feature allows you to display text, style or hide the empty space of a nested data item, which data source returns no records.

Usage

When you want to specify text to show in the rendered report in place of a nested data item that has no data, set the data item NoDataMessage property. At run time, the report engine retrieves the datasource result set and if the result set is empty and the NoDataMessage is specfied, in place of the data item the NoDataMessage is rendered.

The "No Data Message" feature is available for nested Data items: Table, List, Crosstab, Graph, Map. The condition to use the feature is to have a nested Data item with DataSource property set to a valid data object, different than NULL. If the data object is filtered to zero returned records, the feature is triggered.

How To Set NoDataMessage:

  1. Click the data item on the design surface to select it. The Properties Browser displays the properties for the selected item.
  2. In the Properties Browser , expand the No Data node.
  3. Set the NoDataMessage property to the text you want to display. Alternatively, click the Edit(…) button to open the Edit Expression Dialog and create an expression.
  4. Optionally to style the no data message, click the NoDataStyle Edit(…) button and set the style properties according to your requirements.

    The NoDataStyle will be applied only when the NoDataMessage is different from empty string or Null. If you need to change only the data item style when there is no data, you may set the NoDataMessage to whitespace.

"No Data Message" for Reports

Reports do not support the NoDataMessage property. If a report's DataSource returns zero records, only static sections are rendered - Page Header and Footer sections, Report Header and Footer sections, Group Header and Footer sections of groups not based on fields. These sections can be used for displaying a message to the user.

If a report's DataSource is reset or set to NULL, the report preview will show the designed report structure without data, which includes Detail section and dynamic groups' Group Header and Footer sections.

See Also

In this article