Dashboards

This section describes functionality that can be restricted by the software license for JasperReports Server. If you don’t see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

A dashboard displays several reports in a single, integrated view. A dashboard can also include input controls that determine the data displayed in one or more reports, other dashboards, and any other web content. By combining different types of related content, you can create appealing, data-rich dashboards that quickly convey business trends.

This chapter provides details about the dashboard designer and includes the following sections:

User Interface Components
Context Menus
Dashboard Tips and Tricks

User Interface Components

The figure below illustrates the main components of the dashboard designer:

 

Dashboard Components

Component

Description

Available Content

The list of content you can add to the dashboard, including Special Content and repository content. Standard content includes buttons and input controls for the reports you add. Repository content is limited to reports and dashboards; you cannot include analysis views or report resources such as images. You can double-click items in the list to place it automatically in the dashboard, or drag and drop items to place them yourself.

To hide the column of available content, click the icon in the top left corner of the column; this is helpful when arranging content in a large dashboard. Click the same icon on the minimized column to expand it again.

Canvas

Occupying the right side of the designer, the canvas area is a visual editor for your dashboard content. It displays an example of how the dashboard will look, but the contents are not interactive. To interact with the dashboard as it will appear to users, click Preview. Before frames and other content have been added, the dashboard area only displays the title area and the grid, which is helpful in aligning content. Optionally, you can set guide lines to show you the edge of common screen sizes.

Tool bar

These buttons let you interact with the dashboard as a whole or change your view of the designer. The Save button gives you the choice of saving with the current name (overwriting) or saving a copy as a different name. The Options button lets you control the size of the optional guide lines on the canvas.

Title bar

The area of the dashboard where the title is generally displayed. If you do not use this title field, it displays as blank in a dashboard and you can place content over it.

Selection frame

Shows the active element in the dashboard for moving or resizing. Drag anywhere inside the selection frame to move the element. Drag the blue square in the lower left corner to resize it. Click or right-click in any other element to change the selection.

Input control
and label

If your dashboard contains reports that include input controls, they appear in the Special Content folder of the Available Content list. Once you add an input control to the canvas, you can edit its associated label and change the default value. The value of these input controls determine the content of any frames that refer to them.

Free text

Similar to a label, Free Text fields allow you to add text directly to the dashboard. Such text might include instructions about input controls or a description of the dashboard’s purpose. Unlike labels, the font size of Free Text changes when you change the size of its frame.

Standard controls

JasperReports Server provides these standard dashboard controls:

Submit. When this button is included in a dashboard, changes to input control values only update the frame when you click Submit. For more information, refer to the JasperReports Server User Guide.
Reset. Reverts the value of all input controls to their default values saved in the dashboard.
Print. Opens the browser’s Print Preview window and strips off the server’s page headers and footers. In the Print Preview, the Print button is hidden.

Context Menus

Context menus appear when you right-click elements in the dashboard designer. Each menu offers additional options for the selected element.

                              On labels and free text:                  On other elements:

                        

Dashboard Context Menus

For labels and free text, you can also click the text to edit it when the blue selection frame is not active. For reports and custom URLs you can set options such as scroll bars and the refresh interval, as shown in the figure “Dashboard Context Menus”.

Dashboard Tips and Tricks

Here are some tips on designing dashboards:

Multi-select options

When you select multiple frames, you can move or resize them all at once. To select several frames at once, use click-and-drag to draw a box around them or Ctrl-click while you select the frames.

Passing hidden parameters

If a report on the dashboard has a parameter that isn’t mapped to an input control in the dashboard, you can set a value for that parameter by adding it to the URL. To do so, append &hidden_<parameter>=<value>, where <parameter> is the name of a parameter defined in the report and <value> is a valid value for the parameter. For example, to set a dashboard report’s Country parameter to USA, the URL might be similar to:

  http://<hostname>:8080/jasperserver-pro/flow.html?<br />    _flowId=dashboardRuntimeFlow&dashboardResource=<br />    %2Fdashboards%2FMyDash&hidden_Country=USA

The hidden parameter applies to all reports that reference this input control. This can be useful when emailing a link to a dashboard. You can select the default value the recipient will see by editing the URL in the email.

Suppressing server UI decoration

By default, dashboards are displayed on a standard JasperReports Server page called the Dashboard Viewer. This page includes other elements of the user interface such as the search field and main menus. To suppress all of the server UI decoration around the dashboard, add the viewAsDashboardFrame parameter to the dashboard URL as follows:

  http://<hostname>:8080/jasperserver-pro/flow.html?<br />    _flowId=dashboardRuntimeFlow&dashboardResource=<br />    %2Fdashboards%2FMyDash&viewAsDashboardFrame=true

This can be useful when emailing a link to a dashboard. You can strip out the header and footer so the recipient’s eye is drawn to the most important information. This can also be useful when embedding the dashboard in another application.

Embedding a dashboard in another page

You can embed a dashboard in another HTML page outside of JasperReports Server by creating an iFrame and specifying the dashboard’s URL as the iFrame’s src attribute.

The dashboard icons and (normally visible when you hover over a dashboard component) may be missing when the dashboard is embedded in an iFrame. To ensure these icons are visible, add the JasperReports Server CSS class outerDashboardFrame to your iFrame.

Using keyboard shortcuts

You can move or delete dashboard content using your keyboard:

Arrow keys: move up, down, left, or right.
Delete key: delete the selected content.
Escape: close the dialog or cancel edit, depending on your selection.
Ctrl: select multiple frames or buttons. When you are dragging or resizing content, Ctrl disables the snap-to-grid behavior.

Adding labels on input controls

When you add an input control to the dashboard, its label is automatically added as well; you can also add labels manually by dragging the Text Label standard control from the Available Content list. Text labels are like free text elements, but they cannot be resized.

Adding local content, such as images

You can add images and other types of web content to a dashboard. To create a Custom URL frame that displays custom content, either:

Publish the content to a URL-addressable location and create a Custom URL frame that points to it; or
Add the file under the jasperserver-pro directory in your installation, by default <js-install>/apache-tomcat/webapps/jasperserver-pro/. For example, you could create the jasperserver-pro/content directory to hold a file named cow_logo.jpg. The URL to this content would be http://<hostname>:8080/jasperserver-pro/content/cow_logo.jpg.

Custom URLs in dashboards support any content that can be displayed in an iFrame. See the example in Dashboard Tips and Tricks.

Sizing frames

To automatically fit the frame around a report or dashboard, right-click the item and select Size to Content. You can also hide and show scroll bars in frames with other options on the context menu.

Dashboard Tips and Tricks

Feedback