New to Telerik Reporting? Download free 30-day trial

Setting a No Data Message

The No Data Message feature allows you to display text, style or hide the empty space of a nested data item whose data source returns no records, or PictureBox item with a missing or invalid value.

Usage

When you want to specify a text to show in the rendered report in place of a nested data item or PictureBox item, set the item's NoDataMessage property. For data items, the Reporting engine retrieves the data source result set at run time, and if the result set is empty and the NoDataMessage is specified, in place of the data item the NoDataMessage is rendered. For PictureBox items, the Reporting engine processes its Value and, if no valid image is resolved and the NoDataMessage is specified, in place of the PictureBox the NoDataMessage is rendered.

The "No Data Message" feature is available for PictureBox items and nested Data items: Table, List, Crosstab, Graph, Map. The condition to use the feature is to have a PictureBox item with an empty or invalid Value, or a nested data item with a 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 an 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 to display 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