Back to Devexpress

AIServicesEnabled Function

xtrareports-js-devexpress-dot-reporting-dot-viewer-dot-settings-dot-aiservicesenabled-1.md

latest1.8 KB
Original Source

AIServicesEnabled Function

Enables AI-powered functionality in Web Document Viewer and Report Designer Preview.

Declaration

ts
export const AIServicesEnabled: DevExpress.Analytics.Internal.IGlobalSubscribableValue<boolean>

Parameters

NameTypeDescription
newValboolean

true to enable the AI-powered functionality; otherwise, false.

|

Returns

Type
boolean

Remarks

AI-powered functionality configured within AIReportingConfigurationBuilder is available for all Report Viewer and Report Designer components in the application. If you need to disable the AI-powered functionality for a specific Web Document Viewer or Report Designer Preview control, set the client AIServicesEnabled property to false in the BeforeRender event handler. The following snippet disables AI-powered functionality for Report Designer Preview in an ASP.NET Core application:

cshtml
<script type="text/javascript">
    function onBeforeRender(e, s) {
           DevExpress.Reporting.Viewer.Settings.AIServicesEnabled(false);
    }
</script>
@{
    var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
        .Height("100%")
        .ClientSideEvents(configure => configure.BeforeRender("onBeforeRender"))
        .Bind(Model);
    @designerRender.RenderHtml()
}

To disable AI-powered functionality in Web Report Designer, set the Designer.Settings.AIServicesEnabled property to false.

See Also

Summarize and Translate Reports in Web Document Viewer