ReportDesignerClientSideEventsBuilder.ReportOpening(String) Method
Sets the name of the JavaScript function or the entire code that will handle the Web Report Designer‘s client ReportOpening event.
Namespace: DevExpress.AspNetCore.Reporting.ReportDesigner
Assembly: DevExpress.AspNetCore.Reporting.v24.2.dll
NuGet Package: DevExpress.AspNetCore.Reporting
#Declaration
public ReportDesignerClientSideEventsBuilder ReportOpening(
string callback
)
#Parameters
Name | Type | Description |
---|---|---|
callback | String | The name of a Java |
#Returns
Type | Description |
---|---|
Report |
A Report |
#Remarks
The ReportOpening event enables you to perform required actions before a report is opened in the Web Report Designer. When implementing a handling function, use the objects passed as parameters. The first parameter passes the event sender that is the ClientReportDesigner object. The second one is an object with the following structure.
Url
The URL of the report currently being processed.Report
The report currently being processed.Cancel
Specifies whether to cancel opening the report.
The code sample below demonstrates how to use this event to prohibit opening reports with URLs containing a specific substring.
@{
var designer = Html.DevExpress().ReportDesigner("reportDesigner1").Height("1000px")
.Bind(Model.Report)
.DataSources(configureDS => { foreach (var ds in Model.DataSources) { configureDS.Add(ds.Key, ds.Value); } })
.ClientSideEvents(configure => { configure.ReportOpening("reportOpening"); });
}
@designer