Data visualization with SAS programming

Print/Forward/BackButton on my ODS output which has PROC GCHART results

Reply
Occasional Contributor
Posts: 17

Print/Forward/BackButton on my ODS output which has PROC GCHART results

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

Re: Print/Forward/BackButton on my ODS output which has PROC GCHART results

Hi:
I'm just curious -- is something wrong with the PRINT and BACK buttons in the browser that will open the HTML file??

cynthia
Occasional Contributor
Posts: 17

Re: Print/Forward/BackButton on my ODS output which has PROC GCHART results

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

Re: Print/Forward/BackButton on my ODS output which has PROC GCHART results

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]
Post a Question
Discussion Stats
  • 3 replies
  • 151 views
  • 0 likes
  • 2 in conversation