BookmarkSubscribeRSS Feed
KKlee
Calcite | Level 5
I’m creating a PDF document using PROC REPORT and ODS. The PROC is using spanned headers (grouping columns) and regular headers (in the define statement). I need to have output that looks like the “rules=rows” report style, but with rules in the data portion of the report only, not through the headers. I have tried different combinations of styles, compute statements, etc. but I keep getting lines through the headers (between the spanned and regular headers). Is there a way to have rules only in the data lines, not in any of the headers?
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
I do not know of a way in SAS 9.1.3 to get headers treated separately from data cells in PDF. Theoretically, you could use CSS style properties with HTML output or use RTF control strings with RTF output.

If you want a PDF only solution, your best bet for help might be to contact Tech Support or investigate an HTML solution using CSS where you then used a PDF-converter to turn the HTML file into a PDF file. As you can see from the results of running the code below -- the CSS HTMLSTYLE properties are respected for HTML, but not for PDF.

cynthia
[pre]
ods listing close;
options center nodate nonumber;
ods pdf file='rules_rows_sim.pdf' style=journal;
ods html file='rules_rows_sim.html' style=journal;

proc report data=sashelp.class nowd
style(report)={rules=none frame=void
background=_undef_ cellspacing=0}
style(header)={font_style=roman font_weight=bold}
style(column)={background=_undef_
htmlstyle="border-bottom:2px solid"};
title 'Spanning and Rules=Rows Simulation';
column name
("Span-A-Lot-O-Cols" ('Spanning' Age Height)
('Also Span' Weight Sex));
define name /order;
define Age / display 'Age';
define Height /display 'Height';
define Weight / display 'Weight';
define sex / display 'Gender';
compute name;
** put a line on the top and bottom of the 1st obs;
** to put a line under the header, but not under the ;
** spanning header text;
if name = 'Alfred' then do;
call define(_ROW_,'style',
'style={htmlstyle="border-bottom:2px solid;border-top:2px solid"}');
end;
endcomp;
run;

title;
ods _all_ close;
[/pre]
KKlee
Calcite | Level 5
Cynthia,

Thank you for the excellent information and example. I’ll escalate this question to tech support. I'll also confirm that using PDF is a must. Thanks again!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 705 views
  • 0 likes
  • 2 in conversation