Back to Devexpress

ReportStorageWebExtension.CanSetData(String) Method

xtrareports-devexpress-dot-xtrareports-dot-web-dot-extensions-dot-reportstoragewebextension-dot-cansetdata-x28-system-dot-string-x29.md

latest4.2 KB
Original Source

ReportStorageWebExtension.CanSetData(String) Method

Determines whether a report with the specified URL can be saved.

Namespace : DevExpress.XtraReports.Web.Extensions

Assembly : DevExpress.XtraReports.v25.2.Web.dll

NuGet Package : DevExpress.Web.Reporting.Common

Declaration

csharp
public virtual bool CanSetData(
    string url
)
vb
Public Overridable Function CanSetData(
    url As String
) As Boolean

Parameters

NameTypeDescription
urlString

A String specifying the URL that will identify a report in the storage.

|

Returns

TypeDescription
Boolean

True if a report storage can save a report with the specified name; otherwise, false.

|

Remarks

Use the CanSetData method to determine whether a user can save a report with the specified URL. Add custom logic that returns false for reports that should be read-only. Return true if no valdation is required. This method is called only for valid URLs (if the ReportStorageWebExtension.IsValidUrl method returns true ).

For a code example, create a new Web project from the DevExpress Visual Studio template and review the code for the CustomReportStorageWebExtension class in the Services folder.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CanSetData(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.

reporting-aspnet-core-handle-server-side-errors/CS/DXAspNetCoreApp/Services/ReportStorageWebExtension1.cs#L20

csharp
public override bool CanSetData(string url) {
    return base.CanSetData(url);
}

reporting-web-forms-handle-server-side-errors/CS/DXWebApplication1/ReportStorageWebExtension.cs#L17

csharp
public override bool CanSetData(string url) {
    return base.CanSetData(url);
}

reporting-web-forms-handle-server-side-errors/VB/DXWebApplication1/ReportStorageWebExtension.vb#L18

vb
Public Overrides Function CanSetData(ByVal url As String) As Boolean
    Return MyBase.CanSetData(url)
End Function

See Also

Add a Report Storage (ASP.NET Web Forms)

ReportStorageWebExtension Class

ReportStorageWebExtension Members

DevExpress.XtraReports.Web.Extensions Namespace