NAV Navbar
  • Introduction
  • Ad Hoc View Samples
  • Report Samples
  • Dashboard Samples
  • Input Control Samples
  • License
  • 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).

    Fork me on GitHub

    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.

    Download Jaspersoft >

    Installing Jaspersoft

    Note: All fiddles in this guide are live and available to view before install

    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

    Via GitHub

    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:

    Render Table


    Scroll down table for infinite scrolling.

    Loading...



    Customize With CSS

    Crosstab With CSS


    Chart With Selector


    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:

    Set Canvas Type



    Loading...


    Dynamically From A List



    Change visualization type by API:

    Loading...


    Input Controls

    Try: A hard coded or dynamic variable...

          inputSelection = "Non-Consumable"
    

    for parameter control...

          "ProductFamily": ["Food", inputSelection]
    

    Parameter Passing

    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:



    Select any item to pass value.

    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:



    Select filter parameter (Product Category):

    Loading...


    Dynamic Input Control Values

    Build a custom input control dynamically using input control data from an ad hoc view.


    Try it:

    Pass Values

    On selection of a data point pass it's value or field and measure.

    Try it:



    Select any item to pass value.

    Loading...


    Fields And Measures

    Try it:



    Select any data point to pass field and measure
       

    Loading...


    Drill Down On Selection

    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

    Data Rendered On Page

    Render just the Ad Hoc View data on the page or pass to a custom visualization library such as D3.

    Try it:




    Rendering select unit sales data from the first 7 rows of an ad hoc view.

    (View all data in the console)

    Loading...




    Loading Of Data




    Loading...


    Through Return Values

    Navigate the internal data API and return values to update and return the number of columns and rows.



    IC Value
    Count of values received:

    Loading...


    UI Controls

    Try it:

    Table Row Selection



    Loading...


    Column Selection With Highlight

    Select all values on a table row/column using CSS styles to highlight.

    Try it:




    Resize Ad Hoc View

    Ad hoc views are web responsive and the container size can be changed as needed.

    Try it:



    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:

    Refresh

    Hooks for both refreshing and destroying the authentication for an ad hoc view.



    Loading...


    Destroy Session



    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:

    Simple Report Rendering


    Loading...


    From A List





    Loading...


    Load Multiple Reports

    Use a common configuration to load multiple reports.

    Try it:



    Scroll down to view additional reports.

    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:

    Next/Previous


    *Note: Use our pagination events example for even greater control of the beginning and end of pagination points.


    Loading...


    Enter Range


    Page range:
    example formats: 3, 6-8

    Loading...


    Pagination Events





    Loading...


    Anchors


    Report will load default anchor "Cliffside"


    Go to a report anchor:
    For example: Bellingham


    Loading...


    Range With Anchor


    Enter page number or range or use predefined values to narrow down search in report.
    Default bookmark: "Newton".
    Find page/range:

    Loading...


    Anchor And Page Search



    Enter page number or range or use predefined values to narrow down search in report.
    Default bookmark: "Newton".
    Find page/range:

    Or select from a predefined:



    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:

    Parameter Passing


    Enter page number or range or use predefined values to narrow down search in report.
    Default bookmark: "Newton".
    Find page/range:

    Loading...


    Basic Drop-Down


    Enter page number or range or use predefined values to narrow down search in report.
    Default bookmark: "Newton".
    Find page/range:

    Loading...


    Render Values



    Enter page number or range or use predefined values to narrow down search in report.
    Default bookmark: "Newton".
    Find page/range:


    Loading...


    Dynamic Resource Types



    Loading...


    Discover reporting resources available and formats from the JasperReport Server for use with input controls.

    Try it:

    Basic Drill-Down


    Select a city to open a drilldown report under the original.

    Loading...


    Open Report In New Page



    Loading...


    Select a report hyperlink to open a new "drill-down" report with selected parameter.

    Try it:

    Parameter Passing On Selection


    Loading...


    Parameter In A New Page



    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:

    Page Totals


    Loading...


    Report Status



    Loading...


    Listen through events for a change in the page totals and report completed status.

    UI Controls

    Try it:

    Table Column Sorting Order


    Loading...


    Table Column Conditional Formatting



    Selecting the following will add additional formating to our table.
    In this case we are highlighting every numeric value in the "Unit Sales" column that is greater than 3.

    Loading...


    Dynamically control UI elements for table columns.

    Try it:

    Crosstab Column Sorting Order


    Loading...


    crosstab Row Sorting Order



    Loading...


    Dynamically control UI elements for Crosstabs.

    Export

    Try it:

    Export Formats


    Loading...


    Auto Export



    PDF will automatically export for specified report.


    Custom export options with various formats.

    Try it:

    Export CSV And Render


    Loading...


    Export JSON And Render



    Loading report data...


    Export data from a report and render with a custom visualization.

    Save

    Try it:

    Save/Save As UI





    Folder URI
    Label
    Description
    Overwrite

    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.

    Basic Login/Logout



    Loading...


    Login/Logout UI



    Sample login - Organization: organization_1, User ID: joeuser, Password: joeuser
    Authentication Error Logged in Logged out

    Loading...


    A sample UI providing users full authentication options to the JasperReport Server.

    Dashboard Samples

    Basic Embed

    Try it:

    Dashboard Render With Input Control



    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"
            

    Authentication

    Try it:

    Dashboard Login/Logout

    Simple authentication with demonstration of destroying session with dashboards.

    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.



    Loading...


    Custom Input Controls

    Pass a simple set of hard-coded parameters to control report output. This can be expanded with custom inputs controls such as a drop-down. In addition, input control values can be rendered directly from the JasperReport Server.

    Try: A hard coded or dynamic variable...

          inputSelection = "Non-Consumable"
    

    for parameter control...

          "ProductFamily": ["Food", inputSelection]
    

    Try it:

    Dashboard Parameter Passing

    Various inputs for passing parameters into a dashboard.






    Loading...


    Try it:

    Undo/Redo Parameter Events

    Control the dashboard navigation with undo/redo events.



    Parameter ID Set value



    Loading...


    Try it:

    Dashboard Hyperlink

    Passing hyperlinks from one dashboard to open and control a secondary report.



    Select from "Top Fives" report dashlet to render an additional drilldown dashboard under the original.

    Loading...


    Input Control Samples

    Get Input Control Data

    Try it:

    Custom Drop Down



    Show Inside Table




    These examples show accessing data directly from a JRS Input Control.

    The following samples embed JRS Input Controls and/or their data. These first two are the exception in that they only pass data into the application.

    Bind To Report

    Try it:

    Embed Report And Input Control




    Simple embedding of a report and it's associated input control.

    View Control Types

    Try it:

    Render Input Controls (All Types)


    Loading...


    Default Values


    Loading...


    View all JRS input controls, with default values and cascades.

    Reset

    Try it:

    Reset Input Controls

    Change back to originally selected input control values.

    Events

    Try it:

    Listen for changes, with cascade

    Provide events to listen to input control changes, updating the application as needed.

    Try it:

    Bind cascade with report

    Listen to changes with cascade input controls.

    Try it:

    Validation

    Validation result in change event.

    CSS Overrides

    Try it:

    Specific CSS overrides, all types

    Example CSS overrides with JRS input controls.

    This is a sample set of JRS class names for CSS overrides. After embedding, additional class names can be discovered by inspecting the elements on a page.

    License

    Copyright © 2018 TIBCO Software Inc. All Rights Reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

    3. Neither the name of TIBCO Software Inc. nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT OWNER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    THIRD PARTY NOTICES

    *jQuery 1.11.3

    Copyright jQuery Foundation and other contributors, https://jquery.org/

    This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history available at https://github.com/jquery/jquery

    The following license applies to all parts of this software except as documented below:

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    All files located in the node_modules and external directories are externally maintained libraries used by this software which have their own licenses; we recommend you read them, as their terms may differ from the terms above.