Skip to main content
A newer version of this page is available. .

UserDesignerOptions.ReportLoadingRestrictionLevel Property

Specifies whether end-users are allowed to load untrusted reports with potentially dangerous content in a desktop reporting application.

Namespace: DevExpress.XtraReports.Configuration

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

public RestrictionLevel ReportLoadingRestrictionLevel { get; set; }

Property Value

Type Description
RestrictionLevel

A RestrictionLevel enumeration value.

Available values:

Name Description
Enable

Permit loading untrusted reports by end-users via application GUI.

Disable

Forbid loading untrusted reports by end-users via application GUI.

Prompt

Ask for an end-user’s permission on every attempt to load an untrusted report.

Property Paths

You can access this nested property as listed below:

Object Type Path to ReportLoadingRestrictionLevel
Settings
.UserDesignerOptions.ReportLoadingRestrictionLevel

Remarks

When attempting to load a potentially harmful report, desktop End-User Report Designers (WinForms and WPF) display the following warning by default:

report-designer-load-report-warning

A report is considered dangerous on finding any of the following content in it (or in any of its subreports):

The following code illustrates how to disable loading such reports by end-users.

static class Program {
    static void Main() {
        DevExpress.XtraReports.Configuration.Settings.Default.UserDesignerOptions.ReportLoadingRestrictionLevel =
    DevExpress.XtraReports.UI.RestrictionLevel.Disable;
    }
}

Using the code above will result in displaying the following message on an attempt to load a suspicious report by an end-user.

report-designer-load-report-disabled-warning

In a restricted environment, when all reports are guaranteed to be safe, you can disable this warning and allow end-users to load any report by setting the UserDesignerOptions.ReportLoadingRestrictionLevel property to RestrictionLevel.Enable.

The following code enables you to learn whether a specific report is considered dangerous. On finding any security warnings, they will be listed in the Output window of the Visual Studio.

var traceSource = DevExpress.XtraPrinting.Tracer.GetSource("DXperience.Reporting", 
    System.Diagnostics.SourceLevels.Error | System.Diagnostics.SourceLevels.Warning);
var listener = new System.Diagnostics.DefaultTraceListener();
traceSource.Listeners.Add(listener);
try {
    new XtraReport1().ShowRibbonDesignerDialog();
} finally {
    traceSource.Listeners.Remove(listener);
}
See Also