Beginning with SAS Web Report Studio 4.31_M2, you can create conditional highlighting rules that are based on character categories. If you want to create rules based on numeric categories, or if you are using an earlier version of SAS Web Report Studio, this sample explains how you can use the Display as hyperlink feature with a CASE expression in order to conditionally highlight category values. Two examples are included:
Note: The Display as hyperlink feature is available only for relational data.
This sample explains how to edit the expression for a data item to include HTML tags. When you enter the tagging in this way, the highlighting is not preserved when you use the SAS® Add-In for Microsoft Office to open the report directly using Microsoft Office. It is also not preserved when you open the report in SAS® Enterprise Guide®. Instead, you see the HTML tags. In addition, the highlighting might not be preserved when you export from SAS Web Report Studio. The exact behavior in SAS Web Report Studio depends on which version you are using. For more information, see SAS Note 50643.
The information map used in this sample is based on the Exercise data set, which is one of the sample data sets installed with SAS® Enterprise Guide®.
To create the Exercise information map, you can submit the PROC INFOMAPS code on the Full Code tab in this sample. The steps in the sample refer to this information map.
The goal of this example is to highlight whether the subject stretched before exercising. The two values for the Prestretch variable are "No stretch" and "Stretch." "No stretch" should appear in red text and "Stretch" should appear in green text.
case <<Exercise.PreStretch>>
when "No stretch" then "<font color='red'>No stretch</font>"
when "Stretch" then "<font color='green'>Stretch</font>"
else <<Exercise.PreStretch>>
end
|
Tip: If the test query returns an empty column for Prestretch, then increase the length of the data item.
The following steps explain how to see the results in SAS Web Report Studio:
The goal of this example is to highlight the value of the Prestretch variable in red if the value of AnkleWeights is "Weights" and the Energy value is greater than 105. Otherwise, the value of Prestretch is unchanged. In this example, the value of Prestretch within the HTML tags is nonspecific rather than fixed.
case
when <<Exercise.AnkleWeights>> = "Weights" and <<Exercise.Energy>> > 105
then "<font color='red'>"!! <<Exercise.PreStretch>> !!"</font>"
else <<Exercise.PreStretch>>
end
|
Tip: If the test query returns an empty column for Prestretch, then increase the length of the data item.
The following steps explain how to see the results in SAS Web Report Studio:
For more information about SAS Web Report Studio, see the SAS Web Report Studio documentation page.
For more information about SAS Information Map Studio, see the SAS Information Map Studio documentation page.
For more information about SAS Management Console, see the SAS Management Console documentation page.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Before submitting this code, these tasks must be done:
Note: For information about registering libraries and tables, see Establishing Connectivity to a Library of SAS Data Sets.
%let mpath=/Shared Data/your-map-folder;
proc infomaps metauser="your-userID"
metapass="your-password"
metaserver="your-metadata-server.com"
metaport=8561
metarepository=Foundation
mappath="&mpath";
* delete infomap "Exercise";
new infomap "Exercise";
insert datasource
sasserver="SASApp"
table="egsamps"."Exercise" _all_;
save;
* list _all_;
run;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Date Modified: | 2012-03-23 15:13:14 |
Date Created: | 2010-08-31 15:13:32 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Information Map Studio | Microsoft® Windows® for 64-Bit Itanium-based Systems | 4.2_M2 | 9.2 TS2M3 | ||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows XP 64-bit Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Standard Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows XP Professional | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Enterprise 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Enterprise x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Home Premium 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Home Premium x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Professional 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Professional x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Ultimate 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Ultimate x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows Vista | 4.2_M2 | 9.2 TS2M3 | ||||
Windows Vista for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
SAS System | SAS Web Report Studio | z/OS | 4.2_M2 | 9.2 TS2M3 | ||
Microsoft® Windows® for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Standard Edition | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Microsoft Windows XP Professional | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Enterprise 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Enterprise x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Home Premium 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Home Premium x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Professional 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Professional x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Ultimate 32 bit | 4.2_M2 | 9.2 TS2M3 | ||||
Windows 7 Ultimate x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Windows Vista | 4.2_M2 | 9.2 TS2M3 | ||||
Windows Vista for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
64-bit Enabled AIX | 4.2_M2 | 9.2 TS2M3 | ||||
64-bit Enabled Solaris | 4.2_M2 | 9.2 TS2M3 | ||||
HP-UX IPF | 4.2_M2 | 9.2 TS2M3 | ||||
Linux for x64 | 4.2_M2 | 9.2 TS2M3 | ||||
Solaris for x64 | 4.2_M2 | 9.2 TS2M3 |