Skip to main content

SaveComponentsEventArgs.Components Property

Provides access to the list of components that will be saved along with a report’s layout into a REPX file.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v22.2.dll

NuGet Package: DevExpress.Reporting.Core


public IList Components { get; }

Property Value

Type Description

An object, which implements the IList interface, representing the components to be saved.


The XtraReport.SaveComponents event occurs when a report is saved to an REPX file. This event allows you to manually decide which compoents should be stored into a report definition file, and which aren’t. For example, to prevent a particular component from being saved to an REPX file, simply remove this component from the Components collection in the XtraReport.SaveComponents event handler.


This example demonstrates how to exclude a DataSet, along with its TableAdapter, when saving a report definition to an REPX file. To do this, it is necessary to handle the XtraReport.SaveComponents event, and customize its SaveComponentsEventArgs.Components collection.

using System;
using System.ComponentModel;
using System.Data;
using System.Windows.Forms;
using System.Collections;
using DevExpress.XtraReports.UI;
// ...

private void Form1_Load(object sender, EventArgs e) {
    XtraReport1 report = new XtraReport1();
    report.SaveComponents += new 

void report_SaveComponents(object sender, SaveComponentsEventArgs e) {
    int tableAdapterIdx = GetItemIndex(e.Components, typeof(Component));
    if (tableAdapterIdx >= 0)
    int dsIdx = GetItemIndex(e.Components, typeof(DataSet));
    if (dsIdx >= 0)

private static int GetItemIndex(IList components, Type targetType) {
    int idx = -1;
    for (int i = 0; i < components.Count; i++) {
        if (components[i].GetType().BaseType == targetType) {
            idx = i;

    return idx;
See Also