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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 983 views
  • 0 likes
  • 2 in conversation