Desktop productivity for business analysts and programmers

Combining graphs and tables in Enterprise Guide output

Not applicable
Posts: 0

Combining graphs and tables in Enterprise Guide output

I have a data output file with several by groups and I want to generate tables and graphs for these different groups and then combine them side-by-side in the output (either reports in pdf or html). I know that this can be easily done in the document builder for a single instance of a graph and a table but I am generating more than 100 tables using the List procedure and also the some number of graphs for the same data using the Graph function.

The difficulty that I am having is combining them so that there is a table and a graph for the same group of data (by group) on each page of the report (whether pdf or html). Ideally, I would like to generate 100+ pages of output with a graph and corresponding table on each page. When I try to do this in the document builder it always puts either all of the tables first and then the graphs or the reverse. If anyone can help me solve this problem, I would greatly appreciate it. Thanks in advance.
SAS Employee
Posts: 149

Re: Combining graphs and tables in Enterprise Guide output

Posted in reply to deleted_user
Hi Xander,

Maybe someone else has some EG ideas, but this really sounds like a problem most easily solve through programming, specifically Macro programming. You could take the code generated from your graph and list data tasks, turn it into a macro program, and use a %DO loop to go through the 100+ iterations.

In terms of pages, that's a little tricky. HTML doesn't do "pages" per se -- you could get horizontal separators, but not really pages. Or you could get 100+ separate HTML files, again, not really pages. PDF does do pages, but I'm not familiar enough with the ODS statements to control the page stuff. It's not supremely hard, just not my area of expertise.

Other thoughts?
Posts: 9,431

Re: Combining graphs and tables in Enterprise Guide output

Posted in reply to RichardH_sas
The HTMLPANEL destination will do what you want to do (place a table and graph side by side) -- because it uses HTML tags to make a "panel" of table cells and then your tabular output is put into one cell and your graph into another cell.

The HTMLPANEL works because the ODS MARKUP destination has a special "tagset template" that acts differently than regular ODS HTML. To invoke the HTMLPANEL destination, you would use this invocation "sandwich":
ods tagsets.htmlpanel . . . ;

< more sas code >
ods tagsets.htmlpanel close;

As described here:

The hitch for EG folks is that the HTMLPANEL tagset must be available on the server, in a library that is accessible. This may mean that
1) you have to get your SAS administrator to install the HTMLPANEL tagset template on the server;
2) you have to issue an ODS PATH statement in your code to point to the library location on the server -- as set by your SAS Administrator. This need is described in this Tech Support note: (the note is talking about the ExcelXP tagset template, but the general steps apply to ANY tagset template that you might need to use, including the HTMLPANEL tagset template.

This HTMLPANEL tagset template, of course, only works for HTML, not for PDF. If you want to investigate something for ODS PDF, you might investigate the experimental features of ODS LAYOUT. It works in a somewhat similar fashion to the way that the HTMLPANEL tagset works; however, it is experimental (in SAS 9.2) and the syntax may change before it becomes production. Here's some info on ODS LAYOUT: (section 3c and 3d)

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation