ReportStorageExtension.GetData(String) Method
Returns report layout data stored within a report storage medium by the specified report name (identifier).
Namespace: DevExpress.XtraReports.Extensions
Assembly: DevExpress.XtraReports.v24.2.Extensions.dll
NuGet Package: DevExpress.Win.Reporting
Declaration
Parameters
Name | Type | Description |
---|---|---|
url | String | A String that identifies a report in the storage. |
Returns
Type | Description |
---|---|
Byte[] | An array of Byte values that is a report layout definition in XML format. |
Remarks
The GetData method uses a specified name (identifier) to return report layout data stored within a report storage medium. This method is called if the IsValidUrl method returns true.
The following code snippet retrieves reports from a repot storage:
private void buttonPreview_Click(object sender, EventArgs e) {
// Show a preview for a selected report.
XtraReport report = GetSelectedReport();
if (report != null)
report.ShowRibbonPreviewDialog();
}
string GetSelectedUrl() {
return listBox1.SelectedItem as string;
}
XtraReport GetSelectedReport() {
// Return a report by a URL selected in the ListBox.
string url = GetSelectedUrl();
if (string.IsNullOrEmpty(url))
return null;
using (MemoryStream stream = new MemoryStream(Program.ReportStorage.GetData(url))) {
return XtraReport.FromStream(stream, true);
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetData(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.