Welcome to the Visualize.js Live Sample Guide
Visualize.js is a JavaScript API framework used to embed JasperReport Server reports & visualizations
inside web applications.
It comes bundled with the commercial editions of TIBCO JasperReports® Server, specifically Jaspersoft
AWS,
Enterprise or
Professional (and as an add-on with Jaspersoft Reporting).
In this guide you will find a full listing of Visualize.js API code samples.
For greater detail also view the full Visualize.js API reference guide.
Installing Jaspersoft
Note: All fiddles in this guide are live and available to view before install
- Download the commercial edition of JasperReport Server
- Use our quick start guide for installation and configuration
Getting Started
Live Fiddles
View and reuse the live Visualize.js API samples in this guide and(or) reference to your own installation
To use your own install change the following HTML in the fiddles...
<script src="https://mobiledemo.jaspersoft.com/jasperserver-pro/client/visualize.js"></script>
and reference the location of your JasperReport Server installation...
<script src="[myserver]/jasperserver-pro/client/visualize.js"></script>
Video Tutorials
- Need a jump start? Watch our API video tutorials for more information on Visualize.js and embedding inside your application.
Via GitHub
- Fork this Visualize.js API sample set and guide for your own use
- Download our sample application on GitHub featuring Visualize.js
Ad Hoc View Samples
Basic Embed
Initialization of the visualize.js library with simple rendering of ad hoc views using plain text authentication. See full authentication samples in this guide for securing data and views withthe JasperReports Server and Visualize.js.
You can easily change the resource to embed a different view from the JasperReport Server.
For example:
resource: "/public/viz/Adhoc/Change_Visualization2"
Try it:
- JavaScript
- React
- Preview
Loading...
Control Canvas
Control the ad hoc view visualization type (canvas) for users to access. The default visualization selector can be turned off with a line of CSS and only select visualizations used. See dynamic list example for all available visualizations and each name reference.
Try it:
- JavaScript
- React
- Preview
Loading...
Dynamically From A List
- JavaScript
- React
- Preview
Change visualization type by API:
Loading...
Input Controls
Try: A hard coded or dynamic variable...
inputSelection = "Non-Consumable"
for parameter control...
"ProductFamily": ["Food", inputSelection]
Pass a simple set of hard-coded parameters to control ad hoc view output. This can be expanded with custom inputs controls such as a drop-down.
Try it:
- JavaScript
- React
- Preview
Loading...
Basic Drop-Down
Pass a simple set of hard-coded parameters to control ad hoc view output. This can be expanded with custom inputs controls such as a drop-down.
Try it:
- JavaScript
- React
- Preview
Select filter parameter (Product Category):
Loading...
Build a custom input control dynamically using input control data from an ad hoc view.
Hyperlinks
Try it:
On selection of a data point pass it's value or field and measure.
Try it:
- JavaScript
- React
- Preview
Loading...
Fields And Measures
Try it:
- JavaScript
- React
- Preview
Loading...
Select an ad hoc view data point to drill down into data within the same view (container) based on the selected field and measure, updating the visualization type. Pass the same values to render a new ad hoc view on the page.
Try it:
In New View
Custom Visualization
Render just the Ad Hoc View data on the page or pass to a custom visualization library such as D3.
Try it:
- JavaScript
- React
- Preview
Rendering select unit sales data from the first 7 rows of an ad hoc view.
(View all data in the console)
Loading...
- JavaScript
- React
- Preview
Loading...
Through Return Values
Navigate the internal data API and return values to update and return the number of columns and rows.
- JavaScript
- React
- Preview
Loading...
UI Controls
Try it:
- JavaScript
- React
- Preview
Loading...
Column Selection With Highlight
Select all values on a table row/column using CSS styles to highlight.
Try it:
- JavaScript
- React
- Preview
Ad hoc views are web responsive and the container size can be changed as needed.
Try it:
- JavaScript
- React
- Preview
Loading...
Authentication
Hooks for both refreshing and destroying the authentication for an ad hoc view.
Note: Proper authentication needs to be set up with the JasperReport Server and SSO before using token based authentication. View the Authentication Cookbook for details on configuring authentication correctly.
Try it:
Hooks for both refreshing and destroying the authentication for an ad hoc view.
- JavaScript
- React
- Preview
Loading...
Destroy Session
- JavaScript
- React
- Preview
Loading...
Report Samples
Basic Embed
Initialization of the visualize.js library with simple rendering of an HTML report using plain text authentication. See full authentication samples in this guide for securing data and reports with the JasperReports Server and Visualize.js.
You can easily change the resource to embed a different report from the JasperReport Server.
For example:
resource: "/public/Samples/Reports/SalesByMonthReport"
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
Use a common configuration to load multiple reports.
Try it:
- JavaScript
- React
- Preview
Loading...
Pagination
Provide control for report pagination with either individual selectors or a directly inputed range. Also, see pagination with events for full control of inputs.
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Page range:
Loading...
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Go to a report anchor:
Loading...
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Provide the ability to move quickly through reports with direct page anchors. Also see an anchor with a range of rendered pages and an example of searching both an anchor and page/range with an event to callout the current selection.
Custom Input Controls
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
Discover reporting resources available and formats from the JasperReport Server for use with input controls.
Hyperlinks
Try it:
- JavaScript
- React
- Preview
Select a city to open a drilldown report under the original.
Loading...
- JavaScript
- React
- Preview
Loading...
Select a report hyperlink to open a new "drill-down" report with selected parameter.
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
Select from a chart series to pass a parameter into a secondary report. In addition pass this same parameter into a new page/tab.
Events
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
Listen through events for a change in the page totals and report completed status.
UI Controls
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
Dynamically control UI elements for table columns.
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
Dynamically control UI elements for Crosstabs.
Export
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
PDF will automatically export for specified report.
Custom export options with various formats.
Try it:
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading report data...
Export data from a report and render with a custom visualization.
Save
Try it:
- JavaScript
- React
- Preview
Loading...
Custom UI with ability to overwrite reports with location, label and description.
Authentication
Simple plain text authentication with demonstration of destroying session with reports.
Try it:
JRS - Authentication Cookbook >
Note: Proper authentication needs to be set up with the JasperReport Server and SSO before using token based authentication. View the Authentication Cookbook for details on configuring authentication correctly.
- JavaScript
- React
- Preview
Loading...
- JavaScript
- React
- Preview
Loading...
A sample UI providing users full authentication options to the JasperReport Server.
Dashboard Samples
Basic Embed
Try it:
- JavaScript
- React
- Preview
Loading...
Initialization of the visualize.js library with simple rendering of a dashboard (with an embedded input control and hyperlinks) using plain text authentication.
With this example you can easily change the resource to embed a different dashboard from the JasperReport Server.
For example:
resource: "/public/Samples/Dashboards/4._New_Dashboard"