[]
        
(Showing Draft Content)

Control Automatic Report Execution

By default, when all report parameters have default values, the JS Viewer executes the report automatically as soon as the report loads. Although this behavior is convenient in many scenarios, it does not fit every application.

Some applications require users to review or modify parameter values before report generation begins. To support these scenarios, the JS Viewer provides the autoExecuteWithDefaultParams setting, which controls the automatic report execution when all parameter default values are available.

This setting applies only when all report parameters have default values:

  • If the report has no parameters, the setting has no effect.

  • If at least one parameter does not have a default value, the setting has no effect because the viewer already waits for user input.

This option is applied only when the viewer is initialized. To change its behavior, recreate the viewer with a new InitializationOptions object.

Note: This setting affects only automatic execution during report load. It does not affect programmatic execution through run() or equivalent APIs.

Set autoExecuteWithDefaultParams

Set autoExecuteWithDefaultParams in the viewer initialization options.

const viewer = new MESCIUS.ActiveReportsJS.Viewer("#viewer-host", {
    autoExecuteWithDefaultParams: false
});

With this setting, the JS Viewer loads the report, displays the parameters panel with default values, and waits for the user to click Preview.

Example

The following example initializes the JS Viewer and disables automatic report execution when all parameters have default values.

const viewer = new MESCIUS.ActiveReportsJS.Viewer("#viewer-host", {
    reportService: {
        url: "/api/reporting"
    },
    autoExecuteWithDefaultParams: false
});

viewer.open("Reports/Invoice.rdlx-json");