Back to Devexpress

WebDocumentViewerBuilder.AutoStartBuild(Boolean) Method

xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-webdocumentviewer-dot-webdocumentviewerbuilder-dot-autostartbuild-x28-system-dot-boolean-x29.md

latest3.0 KB
Original Source

WebDocumentViewerBuilder.AutoStartBuild(Boolean) Method

Specifies whether to start building a document automatically before the Document Viewer’s UI is rendered.

Namespace : DevExpress.AspNetCore.Reporting.WebDocumentViewer

Assembly : DevExpress.AspNetCore.Reporting.v25.2.dll

NuGet Package : DevExpress.AspNetCore.Reporting

Declaration

csharp
public WebDocumentViewerBuilder AutoStartBuild(
    bool autoStartBuild
)
vb
Public Function AutoStartBuild(
    autoStartBuild As Boolean
) As WebDocumentViewerBuilder

Parameters

NameTypeDescription
autoStartBuildBoolean

true to start building a document automatically; otherwise, false.

|

Returns

TypeDescription
WebDocumentViewerBuilder

A WebDocumentViewerBuilder that can be used to further configure the Document Viewer.

|

Remarks

In ASP.NET Core MVC applications, the Web Document Viewer sends the startBuild request automatically before the Document Viewer’s UI is rendered (if there is no need to wait for parameter values in the UI). If the report has no visible parameters and you set parameter values in the ParametersInitialized event handler and call the Submit() method, the report is generated twice.

Pass false to the AutoStartBuild method to disable automatic document generation:

cshtml
@model DevExpress.XtraReports.Web.WebDocumentViewer.WebDocumentViewerModel
@{
    var viewerRender = Html.DevExpress().WebDocumentViewer("DocumentViewer")
        .Height("100%")
        .AutoStartBuild(false)
        .ClientSideEvents(configure => { 
            configure.ParametersInitialized("onParametersInitialized");
        })
        .Bind(Model);
    @viewerRender.RenderHtml()
}
@* ... *@

See Also

Document Viewer Lifecycle

WebDocumentViewerBuilder Class

WebDocumentViewerBuilder Members

DevExpress.AspNetCore.Reporting.WebDocumentViewer Namespace