The SAS Output Delivery System and reporting techniques

Need rules in data lines but not in headers

New Contributor
Posts: 2

Need rules in data lines but not in headers

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?
Posts: 9,368

Re: Need rules in data lines but not in headers

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.

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}
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"}');

ods _all_ close;
New Contributor
Posts: 2

Re: Need rules in data lines but not in headers

Posted in reply to Cynthia_sas

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!
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation