Table of Contents

Class ListingExportConfiguration

Namespace
Kentico.Xperience.Admin.Base
Assembly
Kentico.Xperience.Admin.Base.dll

Represents the configuration of the listing export action.

public sealed class ListingExportConfiguration
Inheritance
object
ListingExportConfiguration
Extension Methods

Remarks

Enable the export of a listing via EnableExport(ListingConfiguration); pass an instance of this class to customize the export. The export is exposed by the listing page as the ExportListingData(ListingExportCommandArguments, CancellationToken) page command and guarded by the Permission.

Constructors

ListingExportConfiguration()

public ListingExportConfiguration()

Fields

DEFAULT_MAX_ROW_COUNT

Default value of MaxRowCount.

public const int DEFAULT_MAX_ROW_COUNT = 50000

Field Value

int

Properties

AdditionalColumns

Columns exported in addition to the visible columns of the listing table, without being displayed in the table. The columns are exported after the table columns.

public IList<ColumnConfiguration> AdditionalColumns { get; init; }

Property Value

IList<ColumnConfiguration>

Remarks

The columns are retrieved together with the table columns, so they must either be columns of the listed data or be loaded externally (LoadedExternally). They must not be searchable, as the table cannot search by them and the export has to correspond to the table data. Their names must be unique, while the name of a table column can be repeated to export the same data in another representation, e.g. with a different Formatter; columns sharing a name are selected for the export together, as the user selects the exported columns by name. A searchable or duplicate column is rejected with an System.InvalidOperationException.

DataModifier

Function that modifies the data of the whole exported result set before it is written to the file, e.g. to resolve values that cannot be resolved synchronously per cell by a Formatter. Called after Kentico.Xperience.Admin.Base.ListingConfiguration.PageDataModifier. Defaults to null, i.e. the data is exported as retrieved.

public Func<IEnumerable<IDataContainer>, CancellationToken, Task<IEnumerable<IDataContainer>>> DataModifier { get; init; }

Property Value

Func<IEnumerable<IDataContainer>, CancellationToken, Task<IEnumerable<IDataContainer>>>

FileName

Name of the exported file, without the extension. The extension is appended based on the export format. When null, the name is derived from the localized name of the listing page (e.g. "Event-log" for the "Event log" page), with characters not allowed in file names and white space replaced by hyphens.

public string FileName { get; init; }

Property Value

string

MaxRowCount

Maximum number of rows that can be exported. Defaults to DEFAULT_MAX_ROW_COUNT.

public int MaxRowCount { get; init; }

Property Value

int

Remarks

The whole exported result set is held in memory while the file is being built, so the limit protects the application from exporting an unbounded number of rows. When the current listing data exceeds the limit, the export action is disabled on the client and the export command rejects the request.

Permission

Permission required to export the listing data. Defaults to VIEW, i.e. every user who can display the listing can also export it.

public string Permission { get; init; }

Property Value

string

Remarks

The permission is evaluated within the export command against the current application. For applications scoped to a workspace, the permission is evaluated as a workspace permission of the current workspace. When the current user is not granted the permission, the export action is disabled on the client and the export command rejects the request. Administrators are always granted the permission.