Skip to main content

ReportDesignerPreviewClientSideEventsBuilder.PreviewClick(String) Method

Sets the name of the JavaScript function or the entire code that will handle the PreviewClick client-side event of the Web Report Designer‘s Preview.

Namespace: DevExpress.AspNetCore.Reporting.ReportDesigner

Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public ReportDesignerPreviewClientSideEventsBuilder PreviewClick(
    string callback
)

Parameters

Name Type Description
callback String

The name of a JavaScript function or the entire JavaScript function code used to handle the PreviewClick event.

Returns

Type Description
ReportDesignerPreviewClientSideEventsBuilder

A ReportDesignerPreviewClientSideEventsBuilder that can be used to further configure the Report Designer Preview Client Side Events.

Remarks

The PreviewClick event enables performing different actions when an end-user clicks the report document in the Document Viewer built into 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.

  • PageIndex
    A value specifying the zero-based index of the page that has been clicked.

  • Brick
    Provides information on a visual brick representing content of a report control that has been clicked.

  • Handled
    Specifies whether or not the event was handled and no default processing is required.

  • DefaultHandler
    A function that is performed if the Handled field is set to false (the default value). You can call this function within your event handler if required, and set the Handled field to true.

  • GetBrickText
    Returns the text displayed by the report element that has been clicked.

  • GetBrickValue
    Returns additional information on the brick.

The code sample below demonstrates how to obtain the text of an element that has been clicked.

@{
    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.Preview(configure => { configure.PreviewClick("previewClick"); }); } );
}
@designer
See Also