• ShowSaveAsDialog
• ShowOpenDialog
• Load
• Save
• GetErrorMessage
As we see, the interface methods are quite straightforward: the first two methods are intended to show a dialog to an end-user where he can select a report among the predefined reports, or otherwise, save it; when he does that, the Save or Load methods are invoked with the unique name of the selected report. That's where you should implement your custom save logic. If you're unfamiliar with this procedure, please refer to the original E2704 example, which provides additional information in this regard (the example illustrates the same technique but for WinForms EUD)
__________________________________________________________________________________________________________________________________________
[v15.2 History changes]
The IReportFileStorage interface has been changed to IReportStorage.
This new interface provides the following methods:
• bool CanCreateNew();
Indicates where or not it's possible to create a new tab with a blank report in the designer.
• bool CanOpen();
Indicates where or not the "Open" BarItem is enabled.
• 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 given 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 your own UI dialog.
• XtraReport Load(string reportID, IReportSerializer designerReportSerializer);
This method passes the report ID that has been selected in the previous step and expects the actual report instance to be loaded and returned. You may or may not use the IReportSerializer facilities 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 methods parameters are:
- reportID is the unique ID of the edited report (null if it's a new report with no ID specified)
- reportProvider allows you to get 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 BarItem has been pressed ("Save" or "Save As")
- reportTitle represents the actual report title (XtraReport.DisplayName)
- designer is the actual report designer instance (the DevExpress.Xpf.Reports.UserDesigner.ReportDesigner class). Again, it's up to you whether to use it or not
__________________________________________________________________________________________________________________________________________
NOTE:
The WPF Report EUD is still in the beta stage (v.15.2.5); thus, there can be some limitations which are impossible to overcome at this moment (for example, there is no way to fill the SubReport's ReportSource drop-down window with the list of available reports). Moreover, some detail implementation may be changed on its official release. If you're experiencing any issues with running this sample or have additional questions, please contact our Support Team directly for further assistance.