VisibleInReportsAttribute Class

When applied to business classes, specifies whether end-users can create reports on objects of the required class. When applied to a business class property, specifies if the target property is visible in the Report Designer.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.ExpressApp.v18.2.dll


[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Interface, Inherited = false)]
public class VisibleInReportsAttribute :
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Property Or AttributeTargets.Interface, Inherited:=False)>
Public Class VisibleInReportsAttribute
    Inherits Attribute

An application built via the eXpressApp Framework may have the Reporting system. This system allows end-users to create reports on specified type objects (see Create a Report in Visual Studio). For this purpose, the required type should be selected in the Data Type drop-down list in the Report Wizard.


The DataType list's items are added when the corresponding business class has the VisibleInReports attribute. The attribute's VisibleInReportsAttribute.IsVisible property must be set to true.

If the VisibleInReportsAttribute.IsVisible property is set to false, or if this attribute is not applied, the DataType drop-down list in the Report Wizard will not have the required item.

The same behavior is implemented in the Pivot Chart Module. The classes that have this attribute passing the true value are added to the ObjectType dropdown window in an Analysis Detail View. This allows end-users to create an analysis on objects of these classes.


The value that is passed as the VisibleInReports attribute's parameter is set for the IModelClassReportsVisibility.IsVisibleInReports property of the corresponding BOModel | <Class> node.

In the example below, the VisibleInReports attribute is applied to the TestContact class. As a result, the TestContact item is added to the DataType drop-down list (see the image above) in a report's wizard and to the ObjectType drop-down in an Analysis Detail View. This allows end-users to create reports and analysis on existing TestContact objects.

public class TestContact : BaseObject {
   public TestContact(Session session) : base(session) {}
   private string name;
   public string Name {
      get {
         return name;
      set {
         SetPropertyValue("Name", ref name, value);

When you need to apply the CreatableItemAttribute and NavigationItemAttribute attributes in addition to the VisibleInReports attribute, it is easier to apply a single DefaultClassOptionsAttribute attribute.

When the VisibleInReportsAttribute attribute is applied to a business class property, and false is passed as a parameter, the target property is hidden from the Report Designer.




See Also