SAS Visual Analytics reports are accessed via the Report Viewer application in a web browser and it is possible to access a specific report by using the correct URL.
Some reports use parameters as a means of providing interactivity to the report for the consumer. Usually, the parameter values are set interactively by the report consumer using controls within the report, however, it is possible to set values for these parameters via the report URL. This enables, for example, custom filters to be applied or dynamic calculations to be performed as the report is opened, saving the consumer time as they do not have to set the parameter values themselves interactively.
This tip will demonstrate how to form a URL to open a VA report and provide parameter values.
The URL for a SAS Visual Analytics report requires at least three inputs to be specified by the creator. There are optional extra parameters that can be added to further personalise the report when it opens.
The basic URL is compiled as follows;
http://host/SASVisualAnalyticsViewer/VisualAnalyticsViewer.jsp?reportPath=%2FShared%20Data%2F&reportName=Report%201
Each of the parameters must be joined with an ampersand symbol and the URL needs to be written with HTML URL encoding. If the reportName or reportPath include special characters, they will need encoding. Common character encodings are as follows:
‘ ‘ Space %20 ‘.’ Full stop %2E ‘/’ Forward slash %2F
The basic URL can be extended to tailor the view of the report when it is opened, by adding more parameters:
A control object in a report allows the viewer to select a value from a list to filter the report that they are viewing. The value selected in a control object can also be determined using parameters in the URL.
An example use of this would be an email distribution of a report that has a Report Prompt filter for Country. The report viewers in each country would, by default, want to view the report filtered by their own country. The country in which the recipient works can be added as a parameter in the URL so that they don’t need to select it when they open the report.
The steps to achieve this are highlighted below:
1. Create a parameter in the report
2. Assign the parameter to the control object in the report (this can be done in the Roles tab)
3. Compile the URL to be emailed to users.
The parameter name and value need to be added to the basic URL. As such, so to open a report showing only data for England, add &CountryParameter=England to the end of the URL:http://host/SASVisualAnalyticsViewer/VisualAnalyticsViewer.jsp?reportPath=%2FShared%20Data%2F&reportName=Report%201&CountryParameter=England