Usage Note 24051: In ODS RTF, how can I generate HTML hyperlinks?
HTML hyperlinks can be generated with the RTF destination by using the URL=
attribute. For example, if you want to add a hyperlink for
the column headers, use the URL= attribute directly in the
procedures that support the STYLE= option; see example 1.
For procedures that
don't support this option, use URL= in the template.
Example 2 below uses URL= in the CALL DEFINE statement
with PROC REPORT to create hyperlinks within the cell values.
The hyperlinked cell values show up with the color
of blue by default. The below example assumes that the files
that are linked are already in existence, with the name of the value
used as the naming convention.
View output.
/* Example 1 */
ods rtf file='temp.rtf';
proc report data=sales;
column region state sales;
define region / order style(header)={url="http:/www.sas.com"};
define state / order style(header)={url="http:/www.ibm.com"};
define region / order style(header)={url="http:/www.cisco.com"};
run;
ods rtf close;
/* Example 2 */
data sales;
input region $ state $ sales;
cards;
East VA 1000
East DC 2000
East MD 3000
East NC 4000
West CA 5000
West CA 3000
West CA 4000
West AR 3000
South AL 4000
South GA 3000
South TN 2000
North NY 4000
;
run;
ods rtf file="temp.rtf" ;
proc report data=sales nowd;
column region sales ;
define region /group width=80 ;
define sales /sum;
compute region ;
href=trim(region)||".html";
call define(_col_, "URL", href);
endcomp;
run;
ods rtf close;
See more information about
PROC TEMPLATE and the RTF destination.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> RTF
|
Date Modified: | 2004-06-29 14:40:09 |
Date Created: | 2004-06-28 17:23:37 |