Jaspe Reports Viewer

(beans.jasperReportsServoyViewer)

Overview

The JasperReportsServoyViewer is a Servoy bean designed to embed and display JasperReports within Servoy applications. It provides scripting capabilities for customizing visual properties such as background, foreground, font, size, and borders. The bean integrates with the JasperReportsProvider to support dynamic report viewing and customization. ## Functionality Reports can be rendered and displayed using the js_showReport method, which accepts parameters such as data source, report file, and locale. The viewer supports various export formats, configurable through scripting. The bean also facilitates managing paths for report directories and extra resource directories, ensuring integration with the JasperReports plugin. The JRViewer wrapper enables fine-tuned control of the viewer’s display behavior and export functionality.

Properties Summarized

Type
Name
Summary

Sets or gets the background color of the Bean.

This is a readonly property which returns the bean version.

Gets or gets the file save/export formats of the Bean's viewer.

Sets or gets the border type, width and color.

Sets or gets the font type of the Bean's viewer.

Sets or gets the foreground color.

Gets or sets the name of the Bean.

Get or set the relative path or comma separated paths to the extra resource directories of the Servoy JasperReports plugin.

Property for retrieving and setting the path to the reports directory, set by the current client, relative to the server reports directory of the Servoy JasperReports plugin.

Methods Summarized

Type
Name
Summary

Gets the height of the Bean.

Gets the x-coordinate of the Bean's top-left corner location.

Gets the y-coordinate of the Bean's top-left corner location.

Gets the width of the Bean.

void

Sets the size of the Bean.

void

Shows the indicated report in a JasperReports Viewer (in the Bean).

void

Shows the indicated report in a JasperReports Viewer (in the Bean).

void

Shows the indicated report in a JasperReports Viewer (in the Bean).

Properties Detailed

background

Sets or gets the background color of the Bean.

Type String the border color of the bean

Sample

beanVersion

This is a readonly property which returns the bean version. The bean version indicates which version of the Servoy JasperReports plugin the bean should be used with.

Type String the version of the bean; this should be in sync with the version of the plugin used

Sample

beanViewerExportFormats

Gets or gets the file save/export formats of the Bean's viewer.

Type Array the file save/export formats of the viewer

Sample

border

Sets or gets the border type, width and color.

Type String border type, width and color

Sample

displayMode

Type String the display mode of the viewer

Sample

font

Sets or gets the font type of the Bean's viewer.

Type String the font type used in the viewer

Sample

foreground

Sets or gets the foreground color.

Type String the foreground color

Sample

name

Gets or sets the name of the Bean.

Type String the name of the Bean

Sample

relativeExtraDirectories

Get or set the relative path or comma separated paths to the extra resource directories of the Servoy JasperReports plugin. The paths are set per client and are relative to the server corresponding directories setting.

Please refer to the same property of the Servoy JasperReports plugin for more details.

Type String the relative path or paths to the client set extra directory/directories

Sample

relativeReportsDirectory

Property for retrieving and setting the path to the reports directory, set by the current client, relative to the server reports directory of the Servoy JasperReports plugin.

Please refer to the same property of the Servoy JasperReports plugin for more details.

Type String the location of the client set reports directory, relative to the server set path

Sample

transparent

Type Boolean

Methods Detailed

getHeight()

Gets the height of the Bean.

Returns: Number the height of the Bean

Sample

getLocationX()

Gets the x-coordinate of the Bean's top-left corner location.

Returns: Number the x-coordinate of the Bean's top-left corner location

Sample

getLocationY()

Gets the y-coordinate of the Bean's top-left corner location.

Returns: Number the y-coordinate of the Bean's top-left corner location

Sample

getWidth()

Gets the width of the Bean.

Returns: Number the width of the Bean

Sample

setLocation(x, y)

Parameters

Returns: void

setSize(width, height)

Sets the size of the Bean.

Parameters

  • Number width the width of the bean

  • Number height the height of the bean

Returns: void

Sample

showReport(source, report, parameters)

Shows the indicated report in a JasperReports Viewer (in the Bean).

Parameters

  • Object source the datasource (the server name, foundset or dataset) to run the report on

  • String report the report file to export and preview (relative to the reports directory)

  • Object parameters the map of parameters to be used when previewing the report

Returns: void

Sample

showReport(source, report, parameters, localeString)

Shows the indicated report in a JasperReports Viewer (in the Bean).

Parameters

  • Object source the datasource (the server name, foundset or dataset) to run the report on

  • String report the report file to export and preview (relative to the reports directory)

  • Object parameters the map of parameters to be used when previewing the report

  • String localeString the string which specifies the locale

Returns: void

Sample

showReport(source, report, parameters, localeString, moveTableOfContent)

Shows the indicated report in a JasperReports Viewer (in the Bean).

Parameters

  • Object source the datasource (the server name, foundset or dataset) to run the report on

  • String report the report file to export and preview (relative to the reports directory)

  • Object parameters the map of parameters to be used when previewing the report

  • String localeString the string which specifies the locale

  • Boolean moveTableOfContent true in order to move the table of contents, false otherwise

Returns: void

Sample


Last updated

Was this helpful?