The SAS Visual Analytics 7.2 release introduced context sensitive URLs for VA reports which means we can now directly pass parameter values in the URLs! This opens the door and allows for greater flexibility when needing to use a URL to access a VA report.
One use would be if you want to include a direct URL with particular parameter values in a third-party portal or custom application. Another use could be distributing different URLs with varying parameter values depending on the user’s Region interest or Product interest and allowing that person to save the URL as a link in the Hub. That way, no matter what values are used to save the report, the user will always open the report with their region and/or product selected.
Let’s look at what needs to be in place.
All parameters require a control object so that the user can select a value for the parameter. For additional information on the supported control objects for parameters please check out my Using parameters in SAS Visual Analytics blog. The optional role is the Category or Measure role. This role determines if the control object will give the user a pre-determined list of available values depending on the type of control object used.
Here are some examples:
On the Roles tab, I assigned Facility Region to the Category role which results in the button bar displaying the available Regions, i.e. East, North, South and West. Then I assigned the Region Parameter to the Parameter role. This means that the choice of the button bar will be stored in the Parameter named Region_Parameter, notice that a character parameter does not require a current (or default) value.
On the Roles tab, I assigned Unit_Yield_Multiplier_Parameter to the Parameter role. I did not assign a measure to the Measure/Date role because I wanted the parameter’s minimum and maximum values to drive the available values of the slider. Notice that a numeric parameter requires a minimum, maximum and current (or default) value.
Now that we have our parameters in place we can build the VA report URL. There are two styles of URLs, one with the VA Viewer banner and one without the banner. If not already logged into VA, the user will be prompted for credentials when the URL is clicked. To by-pass a log in, there are Guest Access URLs which will not prompt for credentials but then the user is restricted to the Guest Access VA Viewer role capabilities.
Here are the base URLs:
For Guest Access
For Guest Access
Here are the parameters used to populate a fully qualified VA report URL:
- name value pair for Parameter1 …
- name value pair for ParameterN
Here is an example of using the base URL with the VA banner and plugging in the parameters:
How to populate these base URLs with the report name, report path and parameters? Let VA do some of the work for you! From VA Designer, select File then E-mail… this will bring up a window with a generic URL to the VA report.
This URL will have the full path to the report already encoded for us. Look at the value after the location parameter.
We can pull out two of the URL parameters we need from the location parameter. This gives us:
reportName = Report%20-%20Parameters
reportPath = %2FGATE%2FCaseStudy%20Playpen%2FReporting%2FReports%2F
Next, we need to select the report’s parameter name value pairs we want to use.
Region_Parameter = North
Unit_Yield_Multiplier_Parameter = 1.2
Putting it all together in the banner URL gives us:
Now you can adjust the values of your parameters and distribute this custom VA report URL as desired.
Some considerations to keep in mind include:
- Cannot pass a prompt or control object value alone, each control object must have a parameter associated with its Parameter Role
- Only supports available parameter type and control object combinations, i.e. no multiple selection control objects or date values
For additional information on the supported control objects for parameters please check out my Using parameters in SAS Visual Analytics blog.