(Showing Draft Content)

Get Started with ActiveReportsJS JavaScript Report Viewer Component

Create a JavaScript Application

Such an application consists of the HTML markup, CSS styles, and JavaScript code. You can create an index.html file in your favorite text editor and insert the following code into that file.

<!DOCTYPE html>

<html lang="en">
    <meta charset="utf-8" />

    <title>ARJS Report Viewer</title>
    <meta name="description" content="ARJS Report viewer" />
    <meta name="author" content="GrapeCity" />


Install ActivereportsJS

We distribute ActiveReportJS scripts and styles via both CDN and NPM. The easiest way to install the ActiveReportsJS report viewer for a JavaScript application is to add CDN-based references inside the HTML page's head tag. Check Installation for more information about required scripts and styles.

<script src="https://cdn.grapecity.com/activereportsjs/2.latest/dist/ar-js-core.js"></script>
<script src="https://cdn.grapecity.com/activereportsjs/2.latest/dist/ar-js-viewer.js"></script>
<script src="https://cdn.grapecity.com/activereportsjs/2.latest/dist/ar-js-pdf.js"></script>
<script src="https://cdn.grapecity.com/activereportsjs/2.latest/dist/ar-js-xlsx.js"></script>
<script src="https://cdn.grapecity.com/activereportsjs/2.latest/dist/ar-js-html.js"></script>

Add the Report Viewer Host element

Add the div element that will host the report viewer inside the body tag.

<div id="viewer-host"></div>

Add styles for the viewer-host element inside the head tag.

  #viewer-host {
    margin: 0 auto;
    width: 100%;
    height: 100vh;

Add ActiveReportsJS report to the application

ActiveReportsJS uses JSON format and rdlx-json extension for report template files. In the application's root folder, create the new file called report.rdlx-json and insert the following JSON content into that file.

  "Type": "report",
  "Body": {
    "Name": "Body",
    "Type": "section",
    "ReportItems": [
        "Type": "textbox",
        "Name": "textbox1",
        "Style": { "FontSize": "18pt" },
        "Value": "Hello, ActiveReportsJS Viewer",
        "Height": "10in"
  "Name": "Report"

Initialize JavaScript Report Viewer Component

Add the following script in the body tag right after the viewer-host element so that this script would run after the element is rendered. This code initializes the instance of the Report Viewer Component and opens the report template that you added in the previous step.

  var viewer = new ActiveReports.Viewer("#viewer-host");

Run and test the application

You can use any static web-server to run the application. For example, if the http-server package is installed globally, you can run the http-server command from the application's root folder. Make sure that you open the app that runs on the localhost(or When the application starts, the ActiveReportsJS Viewer component will appear on the page. The viewer will display the report that shows "Hello, ActiveReportsJS Viewer" text. You can test the basic functionality by using buttons on the toolbar or exporting a report to one of the available formats.