The SAS Output Delivery System and reporting techniques

Style statement works, PROC TEMPLATE doesn't

Reply
Super Contributor
Posts: 376

Style statement works, PROC TEMPLATE doesn't

Hi,

ods path work.template (update) sashelp.tmplmst (read);

proc template;

  define style mystyle;

parent=styles.normal;

  class Header /

    font=('Arial')

background=#009DE0

foreground=white

  ;

  class Summary /

font_weight=bold

background=#D4D4D4

  ; 

  end;

run;

filename temp temp;

ods _all_ close;

ods escapechar="^";

ods pdf file=temp notoc style=mystyle;

proc report data=sashelp.class (obs=5) nowd spanrows;

  columns name height weight;

  rbreak after / summarize;

  compute after;

    name="Total";

  endcomp;

quit;

proc report data=sashelp.class (firstobs=6) nowd spanrows style(summary)={background=#D4D4D4 font_weight=bold};

  columns name height weight;

  rbreak after / summarize;

  compute after;

    name="Total";

  endcomp;

quit;

ods pdf close;

Why does the first PROC REPORT, using only the style definition, not print the summary line as bold/gray, while the second PROC REPORT, using the style statement, does?

Also, is there documentation/SGF paper that lists ALL the classes (header, rowheader, summary, etc) used in PROC REPORT?  I know I could use tagsets.style_popup and HTML output, but I'd prefer to just lookup the style elements.  I also get the attached error dialog when using the style_popup tagset.

Thanks,

Scott


tagsets_style_popup_runtime_error.png
Super Contributor
Posts: 394

Re: Style statement works, PROC TEMPLATE doesn't

The word "summary" in the style(summary) option refers to the summary location in the report, not the name of a style element. By default PROC REPORT uses the DataEmphasis style element for the summary location. Change class Summary to class DataEmphasis in your first example and it works as you expect.

The documentation for this is here: http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146851.htm#a00053.... Notice in particular the 2nd table, labeled

"Locations and Default Style Elements for Each Statement in PROC REPORT".

Ask a Question
Discussion stats
  • 1 reply
  • 225 views
  • 0 likes
  • 2 in conversation