The SAS Output Delivery System and reporting techniques

How to Stack Reports in ODS HTML

Reply
N/A
Posts: 0

How to Stack Reports in ODS HTML

Hi

I want to know how could we stack two reports produced using proc report into one table. In other words, I have two child reports generated separately by two proc reports. I want to stack them end to end such that the top of the second report is attached to the bottom of the first one.
Super Contributor
Super Contributor
Posts: 3,174

Re: How to Stack Reports in ODS HTML

Research your ODS HTML facility options, however I don't know of a method to directly "fuse" two PROC outputs together with "ODS HTML", assuming you do not want the HTML TABLE body content to be separate (no titles or BY separation). Programming ODS HTML to generate back-to-back PROC outputs is definitely possible, within the same HTML document, using various techniques, such as BY group processing, or iterative invocation with WHERE processing.

For consideration, I find that the SAS support website at http://support.sas.com/ provides many examples and also you can search for topic-oriented references, using relative keywords and phrases. I have provided links to some related SUGI/SGF papers.

Scott Barry
SBBWorks, Inc.
__________________

ODS HTML papers:

http://www2.sas.com/proceedings/sugi29/245-29.pdf

http://www2.sas.com/proceedings/sugi27/p008-27.pdf


SAS Base technical resources home:

http://support.sas.com/rnd/base/
N/A
Posts: 0

Re: How to Stack Reports in ODS HTML

Thanks. But that is not I want. Look into this document below. I want to achieve this in HTML.

http://www2.sas.com/proceedings/sugi31/089-31.pdf
SAS Super FREQ
Posts: 8,743

Re: How to Stack Reports in ODS HTML

Hi:
The paper that you showed did illustrate one way to "stack" tables together. He did it with a custom SAS macro program. You could contact the author of that paper to see whether he will share his macro program with you.

Most of the methods I know involve either creating the 2 tables/reports separately (as SAS data sets) and then concatenating them together and having 1 report job or using DATA _NULL_ -- with a custom table template -- to write out both reports. In the "old" days, people used to use DATA _NULL_ to the LISTING destination (Output Window) for this kind of report.

For example, in this paper, I showed taking the results from PROC FREQ and from PROC MEANS and concatenating the tables together and then using PROC REPORT.
Creating Complex Reports: http://www2.sas.com/proceedings/forum2008/173-2008.pdf
Zip file of programs for paper: http://support.sas.com/rnd/papers/sgf2008/complex_reports.zip

cynthia
Contributor
Posts: 30

Re: How to Stack Reports in ODS HTML

Hi brkiranphm

I know you ask for HTML but since you refer to the RTF paper - if I may also refer you
to the paper(%RiTEN) http://www.phuse.eu/download.aspx?type=cms&docID=221

To stack RTF tables it is very simple to do with post-processing as discussed in the paper. I also discussed another level of flexibility - that is Cell Merging. You can then open the RTF file and save in HTML format.

Having said that - If you can post-process RTF file then you can post-process HTML file. I have not experiment in HTML so do not know dificult this is.


Regards
Duong
www.tranz.co.uk
Contributor
Posts: 30

Re: How to Stack Reports in ODS HTML

Hi brkiranphm

If you run the prog below then open the test.html then delete the 2 lines
indicated and you will see your tables stacked. I have ran this in PC SAS v9.1.3
Once the 2 lines deleted open in IE6 works but FireFox v2 did not seem to work properly.

:



<------ delete this




<------ delete this



:
:


/* test.sas */
ODS HTML FILE='c:\test.html';

proc report data = sashelp.class missing nowindows
style(report) = [just=center outputwidth=60%]
;
column name sex age height weight;
run;

title;

proc report data = sashelp.class missing nowindows noheader
style(report) = [just=center outputwidth=60%]
;
column name sex;
run;

ODS HTML CLOSE;



Regards
Duong
www.tranz.co.uk
Contributor
Posts: 30

Re: How to Stack Reports in ODS HTML

Sorry

The previous post did not display clearly. In meant to say delete these two lines in the test.html.

br <---- delete this
page-break-afer: always etc <---- delete this line and the br few lines above this


Regards
Duong
www.tranz.co.uk
Ask a Question
Discussion stats
  • 6 replies
  • 298 views
  • 0 likes
  • 4 in conversation