The SAS Output Delivery System and reporting techniques

Proc template with columns & header

Reply
Contributor
Posts: 73

Proc template with columns & header

Our web site does not allow frames. The ODS HTML system can easily create a frames setup with a contents, page, and table file completely set up. I need to create the same look, but on the same page and, with a header logo. I assume that means I need a table into which each of the content, page, and stat tables are entered. Can proc template be used to create such a setup? Does anyone have such a template style?
Super Contributor
Posts: 260

Re: Proc template with columns & header

Maybe you could create your own "main" page, using the IFRAME tag instead of the frame panels.
I don't have examples so far, but check a little help on the tag and build the HTML document with a DATA _NULL_ step...

Regards,
Olivier
SAS Super FREQ
Posts: 8,740

Re: Proc template with columns & header

Hi:
You would either have to design your own custom TAGSET template for HTML in order to generate the custom tags you need. What you want to do is NOT a style change -- it is not the style template that builds multiple, linked files -- that happens in the generated HTML tags -- which means you'd have to change the TAGSET template to work differently than it does. Or you would have to generate the kind of HTML tags you want in a DATA step program.

The trick with generating your own tagset is that ODS builds hyperlinks to link the CONTENTS=/PAGE= file with the BODY= file. For example, ODS would build this link for a PROC UNIVARIATE table for Basic Measures:
<a href="body.html#IDX1" target="body">Basic Measures of Location and Variability</a> -- which would be completely wrong if you were dumping both the body output and the contents output into the same file....the body.html would be wrong and the target="body" would also be wrong -- you'd have some work to do to get what you want.

If an HTML frame is not appropriate, how about delivering a PDF file -- where the bookmark area in the PDF file would be the equivalent of the HTML contents file??? Most browsers these days have Acrobat Reader.

cynthia
Super Contributor
Posts: 260

Re: Proc template with columns & header

I'm still stuck to my previous idea, how much clever and wise hints from Cynthia may be.
Here is an example of what I was referring to : IFRAME tagset in a data-step-generated main HTML page. [pre]
ODS HTML PATH = "c:\temp" (URL=NONE)
CONTENTS = "contents.htm"
FRAME = "with_frames.htm"
BODY = "body.htm"
STYLE = astronomy ;
PROC MEANS DATA = sashelp.prdsale MEAN MEDIAN ;
VAR actual ;
CLASS country product ;
WAYS 1 ;
RUN ;
ODS HTML CLOSE ;
DATA _NULL_ ;
FILE "c:\temp\no_frames.htm" ;
PUT "" ;
PUT "" ;
PUT "" ;
PUT "" ;
PUT "
" ;
PUT "" ;
PUT "
" ;
PUT "" ;
PUT "
" ;
RUN ;
[/pre]
It approximately looks like the framed main page produced by the ODS HTML statement, doesn't it ?
Regards,
Olivier
SAS Super FREQ
Posts: 8,740

Re: Proc template with columns & header

Hi, Olivier...

I knew what you meant, but I took the first sentence
"Our web site does not allow frames."
to mean ALL frames, including inline-frames. If the web folks will allow in-line frames, then your method is indeed the better method.

If the web folks will NOT allow in-line frames, then there is a way to create BODY.HTM and CONTENTS.HTM and then essentially use a DATA _NULL_ step to concatenate the 2 files together.

The trick is to create the CONTENTS.HTM file WITH the TOP HTML tags, but WITHOUT the bottom HTML tags, and to create the BODY.HTM WITHOUT the TOP HTML tags, but WITH the bottom HTML tags. That way, when you concatenate the 2 files together, in a simple format, you have the TOC at the top, immediately followed by the BODY content..clicking on links at the top take you further down on the page.

This method doesn't use FRAMES or IFRAMES at all -- but like your program, does do some post-processing to get the 2 files concatenated together. (You could do some fancier processing in the DATA _NULL_ to get 2 tables side-by-side, but the example I have is a simple concatenate.

cynthia
Contributor
Posts: 73

Re: Proc template with columns & header

Cynthia - You are correct. We cannot have inline frames either. I will try your ideas when I get a chance. Thanks to all of you for your ideas.
SAS Super FREQ
Posts: 8,740

Re: Proc template with columns & header

John:
Here's the code sample I described. It was for someone who wanted the TOC info at the top of the BODY info. The key is to change target="body" from the TOC file into target="_self" (otherwise, you're popping up windows every time you click on a link) and to change the file name in the HREF from the ORIGINAL file name (BODY.HTML) to the NEW name (NEWBOTH.HTML). Then, you can get rid of the original HTML files you created and use the new HTML file (NEWBOTH.HTML) on your web site.

cynthia
[pre]
** create contents and body file only;
** do not even create a FRAME= file;
** keep
SAS Employee
Posts: 95

Re: Proc template with columns & header

I have a tagset that floats the table of contents either as a pulldown menu or as a tree in the upper
left corner of the body file.

I think that will do what you want. If you send me an email I will send it to you.

Eric.
SAS Employee
Posts: 95

Re: Proc template with columns & header

My email is Eric.Gebhart@sas.com...
Ask a Question
Discussion stats
  • 8 replies
  • 234 views
  • 0 likes
  • 4 in conversation