BookmarkSubscribeRSS Feed
ScottBass
Rhodochrosite | Level 12

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

Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
1 REPLY 1
Tim_SAS
Barite | Level 11

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".

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1024 views
  • 0 likes
  • 2 in conversation