Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

WPF End-User Report Designer - How to Implement a Report Storage

$
0
0

This example demonstrates how to implement report storage to persist report definitions in a database or in any other custom location. This enables your end-users to create and customize reports using the End-User Designer for WPF and have a common target for saving and sharing all reports. This functionality is accomplished through the DevExpress.Xpf.Reports.UserDesigner.IReportStorage interface. The interface provides the following methods:

• bool CanCreateNew();

Indicates whether or not it is possible to create a new tab with a blank report in the designer.

• bool CanOpen();

Indicates where or not the "Open" command is available.

• XtraReport CreateNew();

Provides the capability to customize a new report template.

• XtraReport CreateNewSubreport();

Provides the capability to customize a new subreport report template (i.e., a new report opened by double-clicking a specific XRSubreport control).

• string GetErrorMessage(Exception exception);

Provides the capability to display an error message for any encountered exception (a general one or the exception message if you expect that the user can understand and react based on this information).

• string Open(IReportDesignerUI designer);

This method expects a unique ID of the report selected by an end-user via a custom dialog.

• XtraReport Load(string reportID, IReportSerializer designerReportSerializer);

This method passes the report ID that has been selected at the previous step and expects the actual report instance to be loaded and returned. You may or may not use the IReportSerializer functionality to save or load a given report from a stream.

• string Save(string reportID, IReportProvider reportProvider, bool saveAs, string reportTitle, IReportDesignerUI designer);

This method is intended to save the currently edited reports. The method's parameters are:

- reportID is a unique ID of the edited report (null if it is a new report with no ID specified);

- reportProvider allows you to access the actual report instance being edited and optionally rename it (a new name will be updated in the designer as well);

- saveAs indicates which particular command has been executed ("Save" or "Save As").

- reportTitle represents the actual report title (the XtraReport.DisplayName property value).

- designer is the actual report designer instance (a DevExpress.Xpf.Reports.UserDesigner.ReportDesigner object).

 

See also: Report Storage for the WinForms End-User Report Designer.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>