(Showing Draft Content)

ActiveReportsJS Report Viewer component

This page provides a detailed overview of the ActiveReportsJS Report Viewer component. You can check Get Started tutorial for a concise guide for integrating this component to a pure JavaScript application.

ActiveReportsJS scripts and styles

To use ActiveReportsJS Viewer component in a pure JavaScript application, it should include the following scripts and styles:

  • ar-js-core.js: required, provides the core functionality
  • ar-js-viewer.js: required, provides the viewer component
  • ar-js-ui.css: required, provides the common style for ActiveReportsJs components
  • ar-js-viewer.css: required, provides the default style for viewer component
  • ar-js-pdf.js: optional, provides export to PDF
  • ar-js-xlsx.js: optional, provides export to XLS
  • ar-js-html.js : optional, provides export to HTML

The easiest way to include these scripts is to use CDN references, for example:

<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>

Alternatively, you can download these scripts and styles from the ActiveReportsJS Download Page. You can find them in the dist and styles folders of the download package, respectively.

Finally, @grapecity/activereports package can be installed in an application's folder and these scripts can be referenced from node_modules\@grapecity\activereports\dist\ and node_modules\@grapecity\activereports\styles\ folders

Initializing ActiveReportsJS Viewer Component

Once scripts and styles are loaded, Viewer component can be initialized by invoking ActiveReports.Viewer constructor and passing the CSS selector of the hosting element into it, for example:

    <div id="viewer-host"></div>
        var viewer = new ActiveReports.Viewer("#viewer-host");

The instance of ActiveReports.Viewer exposes methods and properties that can be used to customize viewer appearance, preview reports, print or export them.