Custom Report Storage
- 2 minutes to read
This document explains how you can implement a storage for an End-User Report Designer where all reports are retained: a database, an eXpress Persistent object, a ZIP file, or any other location.
Windows Forms
You can store report definitions in a database or in any other custom location. This may be useful when providing end-users with the capability to create and customize reports using the End-User Designer, if it is necessary to have a common target for saving and sharing all reports.
To implement a Report Storage in your Report Designer, create a custom report storage object that inherits from the ReportStorageExtension class. The following are its essential members.
Save reports
- the ReportStorageExtension.SetData method saves a report to a specified location in a Report Storage: file or stream (use ReportStorageExtension.IsValidUrl for checking this).
- the ReportStorageExtension.SetNewData method saves a report as a new location in a Report Storage.
Restore reports
- the ReportStorageExtension.GetData method restores a report from a specified location in a Report Storage (use ReportStorageExtension.CanSetData for checking that it can).
- the ReportStorageExtension.GetNewUrl method returns a unique URL for a report being restored.
Manage reports
- the ReportStorageExtension.GetStandardUrls method returns the array of all locations (file URLs or stream objects) that exist in a Report Storage.
- the ReportStorageExtension.GetStandardUrlsSupported determines whether or not standard URLs are supported by this Report Storage type.
After you have defined your Report Storage type, register it by calling the static ReportStorageExtension.RegisterExtensionGlobal method.
Examples
An in-depth sample application is available online at Report Storage for the End-User Report Designer.
It demonstrates how to store reports in the following formats:
a DataSet object (the DataSetReportStorage class);
an XPCollection object (the XpoReportStorage class);
a single ZIP file (the ZipReportStorage class).
Alternatively, you can use the following online resources.
- Blog: WinForms - End-User Report Designer Custom Report Storage
- Video: WinForms Reporting - Saving Reports
To serialize custom objects (such as custom parameters or data sources), you can extend the standard CodeDOM logic of storing report definitions by implementing XML serialization.
WPF
To implement a report storage to persist report definitions in a database or in any other custom location, use the methods of the IReportStorage interface. This approach is illustrated in the Store Reports in the Report Designer document.
ASP.NET
To learn how you can provide a server-side storage for your web reports, refer to the following document: Add a Report Storage.