ReportGalleryDirectoryExtension Class
Enables you to provide a custom file storage for the Report Gallery in WinForms and WPF applications.
Namespace: DevExpress.XtraReports.Extensions
Assembly:
DevExpress.XtraReports.v24.2.dll
NuGet Package:
DevExpress.Reporting.Core
Declaration
public class ReportGalleryDirectoryExtension :
ReportGalleryExtension
Public Class ReportGalleryDirectoryExtension
Inherits ReportGalleryExtension
The Report Gallery stores templates in the %localappdata%\Developer Express Inc\XtraReports Suite\ReportGallery.xml file.
You can use the ReportGalleryDirectoryExtension class to provide a custom file storage. This class is inherited from the abstract ReportGalleryExtension class.
Do the following to store the Report Gallery’s templates in another file:
- Create a new ReportGalleryDirectoryExtension class instance and pass the full file path as the constructor parameter.
- Pass this instance to the static ReportGalleryExtension.RegisterExtensionGlobal method.
The code below demonstrates how to store templates in the directory that contains the application’s executable file.
WinForms
using System.IO;
using DevExpress.XtraReports.Extensions;
// ...
string path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "ReportGallery.xml");
ReportGalleryExtension.RegisterExtensionGlobal(new ReportGalleryDirectoryExtension(path));
Imports System.IO
Imports DevExpress.XtraReports.Extensions
' ...
Dim path As String = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "ReportGallery.xml")
ReportGalleryExtension.RegisterExtensionGlobal(New ReportGalleryDirectoryExtension(path))
WPF
using System;
using System.IO;
using DevExpress.XtraReports.Extensions;
// ...
string path = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), "ReportGallery.xml");
reportDesigner.ReportGalleryOptions.Storage = new ReportGalleryDirectoryExtension(path);
Imports System
Imports System.IO
Imports DevExpress.XtraReports.Extensions
' ...
Private path As String = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), "ReportGallery.xml")
reportDesigner.ReportGalleryOptions.Storage = New ReportGalleryDirectoryExtension(path)
See the following topics for more information:
See Also