Usage Note 24459: How can I use PROC REPORT to link from one page in my PDF file to another?
In SAS 9 and later, the ANCHOR= option on the ODS PDF statement inserts anchors into an ODS PDF output file. You can use PROC REPORT with CALL DEFINE to automate the process of linking to the anchored pages.
The sample code in the FULL CODE tab creates a PDF file with links to the PACIFIC and CANADA detail pages. Please note that the capitalization of the ANCHOR= values can effect the functionality. See SAS Note 37323 for additional information.
See also SAS Note 24174 for additional information about links in the ODS PDF 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.
The sample code creates a PDF file with links to the PACIFIC and CANADA detail pages. Please note that the capitalization of the ANCHOR= values can effect the functionality. See SAS Note
37323 for additional information.
proc template;
define style mystyle;
parent=styles.sasdocprinter;
/* TEXT= is left justified by
default. I'd like it centered */
style usertext from note /
just=c;
/* I want PAGEOF information too */
style PageNo from TitlesAndFooters /
font_weight=medium
pretext = "Page "
posttext = " of ^{lastpage}";
end;
run;
title;
/* close the OUTPUT window */
ods listing close;
options orientation=portrait center nodate;
ods escapechar="^";
ods pdf file="file.pdf" startpage=no style=mystyle;
ods pdf text="Click on a highlighted REGION to see details";
ods proclabel="SASHELP.SHOES";
proc report nowd data=sashelp.shoes contents="LINKS Page";
col region sales ;
define region / group;
compute region;
/* for purposes of illustration, we are linking
to 2 regions on later pages in this PDF file */
if region in ("Pacific","Canada") then do;
urlstring="#"||lowcase(left(region));
call define('_c1_','url',urlstring);
end;
endcomp;
run;
/* create a "footnote" that is placed close to the
REPORT table */
ods pdf text="^2n Prepared on: &sysdate9." ;
/* create an ANCHOR to point to the CANADA page
STARTPAGE= forces this onto a new page
COLUMNS= makes a 2 column page */
ods pdf anchor="canada" startpage=now columns=2;
title "Canada";
ods proclabel="Canada";
proc report data=sashelp.shoes(where=(region="Canada")) nowd contents="";
col subsidiary product sales;
define subsidiary / group;
define product / group;
rbreak after / summarize;
run;
ods pdf anchor="pacific" startpage=now;
title "Pacific";
ods proclabel="Pacific";
proc report data=sashelp.shoes(where=(region="Pacific")) nowd contents="";
col subsidiary product sales;
define subsidiary / group;
define product / group;
rbreak after / summarize;
run;
ods pdf close;
Type: | Usage Note |
Priority: | low |
Topic: | System Administration ==> Printing SAS Reference ==> Procedures ==> REPORT Third Party ==> Output ==> PDF SAS Reference ==> ODS (Output Delivery System)
|
Date Modified: | 2010-10-27 11:45:10 |
Date Created: | 2005-11-30 11:29:27 |