Skip to main content Skip to footer

Add Report Parameters to the Viewer Component with the ARJS API

With the ActiveReportsJS API, you can easily add parameters to your report when displaying it in the Report Viewer Component. To do so with Vanilla JavaScript, add the following code to the open method that you call on your viewer instance:

viewer.open("report.rdlx-json", {
    ReportParams: [
        {
             Name: "CategoryId",
             Value: [1,2,3],
        },
    ],
});  
In the above scenario, 'report.rdlx-json is the name of your report file, and the ReportParams array is a list of objects containing a Name and Value property for each report parameter. You can tweak the above code to dynamically pass parameters at runtime. 
To see more about the parameters that can be passed to the open method of the viewer, take a look at our documentation here. If you have more questions regarding the topic, please create a ticket with our engineering team to get in-depth support.

Christian Wirt