Using Custom Report Definition Storage
This article describes how to use the Web Report Designer to design reports that are stored in a custom storage location.
Overview
Out-of-the-box, we provide a FileDefinitionStorage
that is configured to use the file system. To open reports stored differently, you need to implement the IDefinitionStorage
interface. This will enable the web designer to load reports from a custom location, such as a database, cloud, in-memory, etc.
The Web Report Designer previews the reports in the HTML5 Report Viewer. The latter utilizes a Telerik Reporting REST Service to render the reports. The client-side reportSource sent by the web designer is resolved to a server-side ReportSource by the
Resolve
method of the Reporting REST Service ReportSource Resolver. The ReportSource resolver is supposed to read report definitions created with the web report designer. For that reason, in the most of the cases when creating customIDefinitionStorage
it will be necessary to create also a custom IReportSourceResolver that is able to read the report definitions from the storage and return them as valid server-side ReportSources.
Implement Custom Storage
The purpose of the report definition storage is to describe how to browse, open, save, and delete reports from the Web Report Designer. The storage is configured as a setting of the ReportDesignerServiceConfiguration
.
The default implementation of the storage is the FileDefinitionStorage
. It provides functionality for working with TRDP
/TRDX
report files stored on the server-side file system. To load the reports from a custom storage, change the ReportDesignerServiceConfiguration.DefinitionStorage
property to point to an instance of the class with the custom implementation of the definition storage, for example:
public ReportDesignerController()
{
//...
this.ReportDesignerServiceConfiguration = new ReportDesignerServiceConfiguration
{
DefinitionStorage = new CustomDefinitionStorage(),
SettingsStorage = new FileSettingsStorage(this.reportsSettingsPath)
};
}
A full implementation of a custom IDefinitionStorage
using MSSQL database and Entity Framework Core for .NET 7 is available in our GitHub Reporting Samples repository SqlDefinitionStorageExample. More details about the specific implementation may be found also in the KB article Implementing EFCore MSSQL IDefinitionStorage