Basic embedded report JavaScript parameters and examples
This section explains the report URL parameters with examples.
Using the JavaScript API
You can use a single JavaScript URL to load a report or dashboard on your HTML page. You can also customize the report or dashboard to display and load content on demand from other scripts.
On your HTML page, include a script tag that points to your Remedy Smart Reporting server. Include the report or dashboard identifier as a parameter in the URL, for example:
<script type="text/javascript" src="http://reporting.example.com/JsAPI?reportUUID=e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63"></script>
<script type="text/javascript" src="http://reporting.example.com/JsAPI?dashUUID=3b0b6c9a-9dfb-41f0-b85a-eb17bb8aeeb9"></script>
The URL to the API is based on the URL used to access the Remedy Smart Reporting front end. For example, if you access Remedy Smart Reporting through http://reporting.example.com:8080/, the JavaScript API URL is http://reporting.example.com:8080/JsAPI. The URL is accessible from anywhere (internal network, external, VPN, and so on).
Report URL Parameters
The reportUUID parameter identifies a report. For backwards compatibility, the reportId or wsName parameters also identify the report.
You can add other parameters, which can alter the way the report is displayed. The available parameters are:
Parameter | Description |
---|---|
reportUUID | The unique ID identifying the dashboard to load. The reportUUID, reportId, or wsName parameter is required. |
reportId | The numeric report ID identifying the report to load. The reportUUID, reportId, or wsName parameter must be present. Note: We recommend using the reportUUID parameter. |
wsName | The Web Service name identifying the report to load. The reportUUID, reportId, or wsName parameter must be present. Note: We recommend using the reportUUID parameter. |
elementId | The ID of the html element in which to load the report. If this is not included, a container element is created when the script tag is included. |
showTitle | Displays the title bar at the top of the report. The default is true. To omit the title bar at the top of the report, set the parameter to false. All interactive buttons included in the title bar are also omitted. |
showInfo | Displays the Info button in the title bar. The default is true. To omit the Info button in the title bar, set the parameter to false. |
showFilters | Displays the Filters button in the title bar. The default is true. To omit the Filters button in the title bar, set the parameter to false. Any user-prompt filters are not displayed. |
showSections | Displays the Sections button in the title bar (for reports with tabbed or multi-page sections). The default is true. To omit the Sections button in the title bar, set the parameter to false. |
showSeries | Displays the Series button in the title bar (for reports with the series selection option). The default is true. To omit the Series button in the title bar, set the parameter to false. |
showPageLinks | Displays the previous page/next page button in title bar (for reports with multiple pages). The default is true. To omit the previous page/next page button in the title bar, set the parameter to false. |
showExport | Displays the Export button in the title bar. The default is true. To omit the Export button in the title bar, set the parameter to false. |
height | Overrides the report height. Enter a numeric value. |
width | Overrides the report width. Enter a numeric value. |
display | Sets how the report is initially displayed. To display the report initially as a table, set the parameter to table. To display the report initially as a chart, set the parameter to chart. The default is chart. Note: This parameter is ignored for reports that do not have table and chart. |
fitTableWidth | Scales the report table to the width of the enclosing element. The default is true. |
canChangeDisplay | Enables users to switch between a chart and table display. The default is true. To omit the buttons that enable users to switch between a chart and table display, set the parameter to false. |
username | (Required) The Remedy Smart Reporting user name to authenticate when loading the report. Set this parameter with the password parameter. Setting this parameter avoids the need for users to enter their login details before viewing restricted reports. |
password | (Required) The password of the user in Remedy Smart Reporting. Set this parameter with the username parameter to authenticate a particular user when loading the report. |
token | A web service token to authenticate a user when loading the report. |
clientOrg | The name of the client org. |
Examples
The following example includes a report and sets the dimensions of the report:
The following example uses an existing element in which to display the report:
<script src="http://localhost/JsAPI?reportUUID=e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63&elementId=myReportDiv&username=<reportingUser>.com.au&password=test&clientOrg=bmc"type="text/javascript"></script>
</div>
The following example uses an existing element in which to display the report, overrides the report dimensions, and changes some of the initial display options:
<script src="http://localhost/JsAPI?reportUUID=e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63&elementId=myReportDiv&width=400&height=300&showFilters=false&display=table&username=<reportingUser>.com.au&password=test&clientOrg=bmc"type="text/javascript"></script>
</div>