Data visualization with SAS programming

Adding a forward button in ODS Body

Reply
Frequent Contributor
Posts: 78

Adding a forward button in ODS Body

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
SAS Super FREQ
Posts: 8,720

Re: Adding a forward button in ODS Body

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
SAS Employee
Posts: 967

Re: Adding a forward button in ODS Body

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]";
SAS Super FREQ
Posts: 8,720

Re: Adding a forward button in ODS Body

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Adding a forward button in ODS Body

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.
Frequent Contributor
Posts: 78

Re: Adding a forward button in ODS Body

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Adding a forward button in ODS Body

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.
SAS Employee
Posts: 967

Re: Adding a forward button in ODS Body

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 :-)
Frequent Contributor
Posts: 78

Re: Adding a forward button in ODS Body

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! Smiley Happy

*************************************************************
%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)
*************************************************************
Ask a Question
Discussion stats
  • 8 replies
  • 241 views
  • 0 likes
  • 4 in conversation