BookmarkSubscribeRSS Feed
Soha
Calcite | Level 5
Hi,

I am using ODS HTML along with PROC GCHART to get my results. I need to add the Print and Back buttons at the bottom of the results. I searched the forum and found that using PROC TEMPLATE we will be able to add Buttons to our ODS output but those outputs are tabular outputs ( like output from proc print which basically shows table) and the style statement used there ("Style table from output / ...") can be used only when my output is table. Is there a similar statement for Chart output? If not, how else could this be done? I know we can use "link" with footnote statement to go back and forth but how can we get the print functionality done?

Any help would be highly appreciated. Thanks!

Sohail
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
I'm just curious -- is something wrong with the PRINT and BACK buttons in the browser that will open the HTML file??

cynthia
Soha
Calcite | Level 5
Cynthia,

No, they work fine.

But I was curious to know if what we can do for tabular output can we do it for chart output too, and also for consistency purposes. We are showing the buttons for tabular results so would like to have such buttons for graphical results too ( the graphical results donot correspond to tabular results, they are results from two different analysis, but complement each other)

Thanks
Sohail
Cynthia_sas
SAS Super FREQ
Hi:
You can still use the style template techniques to put a PRINT and BACK button into the HTML file. For example instead of attaching the button to the TABLE style element you could attach the button to the BODY style element or the SystemTitle or SystemFooter style element. You can put the SAS TITLE and SAS FOOTNOTE outside of the graph area using the NOGTITLE, NOGFOOTNOTE options of ODS HTML. Then, with the TITLE or FOOTNOTE outside of the graph image, the style template would impact the title and/or footnote.

cynthia

[pre]
** SystemFooter is the style element that controls the FOOTNOTE statement text;
proc template;
define style styles.back_butn;
parent=styles.sasweb;
class SystemFooter /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()"></div>' ;
end;
run;

ods listing close;
ods html path='c:\temp' (url=none)
gpath='c:\temp' (url=none)
file='use_back3.html' style=styles.back_butn
nogtitle nogfootnote;

** your code (with a footnote statement);
ods html close;
[/pre]

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1253 views
  • 0 likes
  • 2 in conversation