BookmarkSubscribeRSS Feed
Yennie
Calcite | Level 5
Hello People,

just wanting to find out if it's possible to add a button in an ODS body so that it allows the user to jump to the next page? Something similar to HTMl href function.

Cheers.
Yennie
8 REPLIES 8
Cynthia_sas
SAS Super FREQ
Hi:
This is probably not a SAS/GRAPH question. A search at support.sas.com, using the search string
ODS HTML button
revealed several hits, this among them:
http://support.sas.com/kb/23/342.html

For more help with the PROC TEMPLATE techniques described in the Tech Support note, you might want to open a track with Tech Support or read some of the PROC TEMPLATE FAQ at this site:
http://support.sas.com/rnd/base/ods/templateFAQ/index.html

cynthia
GraphGuy
Meteorite | Level 14
One easy way to "fake it" would be to use a footnote with an html link, such as ...


footnote2 color=gray justify=right link="url-of-next-page" "[next]";
Cynthia_sas
SAS Super FREQ
Good point. I always forget about LINK= option. Mostly because to use it, I have to plan ahead and figure out what the name of file is going to be in order to code the link correctly.

For navigation between separate HTML pages, the use of NEWFILE=, FRAME=, CONTENTS= and BODY= might work, too. This would mean that ODS would build the links to the next file automatically and the file name would not need to be known ahead of time. Even without NEWFILE=, the use of FRAME= and CONTENTS= puts links into the navigation pane to facilitate going back and forth in a big HTML document.

cynthia
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
I have done this, however it involved post-processing the SAS-generated HTML document, where I still had to deal with ODS HTML pagination challenges.

The final HTML document contained HTML ANCHOR tags (incrementing, unique identification) for the forward hyperlink reference at the bottom of each logical page-view within the HTML document.

Typical SAS DATA step logic was used to post-process the HTML document.

Scott Barry
SBBWorks, Inc.
Yennie
Calcite | Level 5
Hey Robert,

I didn't even think of that in the beginnning. works really well for me.

thank you so much for that!

Really appreciate this,
Yennie
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Honestly, I am curious how the OP will solve the original question by adding a fixed URL string to resolve jumping to the next-page within the same HTML document.

As stated, I don't think it's possible without generating HTML ANCHOR tags for each logical page-view and manipulating the URL string in the BUTTON's HREF= reference.

For others' benefit, it will be useful to hear back from the OP with the final, coded solution, please. Thank you.

Scott Barry
SBBWorks, Inc.
GraphGuy
Meteorite | Level 14
The Original Poster (OP) didn't necessarily say they wanted to jump to the next page in the same document ... just the next page they want the user to go to 🙂
Yennie
Calcite | Level 5
Hi Scott,

The ODS and "Next" are within my macro script so it really didn't matter whether if it's a "Next" link or a "Back" link.

A simplified code as below. (Real simple I know) Hope it didn't look silly to you!

Thank you guys so much for your awesome help! 🙂

*************************************************************
%Macro html_page ( output_html=, name_html= )
ODS HTML Body = &output_html;
TITLE;
FOOTNOTE Color=Black Justify=right link="&name_html." "[View Cancellation Results]";

PROC PRINT DATA=Fruit
NOOBS LABEL;
VAR sales earnings days;
BY Month
RUN;QUIT;

Title; FOOTNOTE;
GOPTIONS RESET=ALL;
ODS HTML Close;
%Mend html_page ;
%html_page (output_html=renewalA.html , name_html=cancellationA.html)
%html_page (output_html=renewalB.html , name_html=cancellationB.html)
%html_page (output_html=renewalC.html , name_html=cancellationC.html)
*************************************************************

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1080 views
  • 0 likes
  • 4 in conversation