BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hello
is there a way to control the width of the horizontal lines in a proc report with sas 9.1 ?
to quote an example, i want that my horizontal line number 5 when i print the table sashelp.class appears bigger than the other ones.
Can i do this ? thank you.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
This is one of those "it depends" answers.

First, "bigger" can mean wider (a longer line than the other lines), bigger font size or higher (taller line than the other lines). And, second, it depends on what destination you're talking about.

Generally, if you are talking about LISTING destination or the Output Window, the answer is NO -- with PROC PRINT and NO with PROC REPORT except at a break point using a LINE statement -- and yes with DATA step to FILE PRINT. If you are talking about ODS destinations, such as HTML, RTF or PDF, the answer is MAYBE. ...And that really depends on what you mean by bigger.

If you mean you want the report row for Observation 5 to extend -outside- the boundary of the report table (wider) that is not possible because your whole report is in a TABLE and one row in the table cannot be WIDER than the whole table -- for ODS destinations like RTF, PDF and HTML. This is where DATA step to LISTING with PUT statements could let you construct lines however you wanted -- but that kind of "free-format" output is really only available in listing. But, if you want the font_size for the Observation 5 row to be bigger in ODS HTML, RTF and PDF, you can do that -- with PROC REPORT (not PRINT). (And of course, everything is pretty much one font size in the LISTING window -- so that's a NO for LISTING).

Consider this example for making the font size of observation 5 bigger:
[pre]
ods html file='c:\temp\big5.html ' style=sasweb;
ods rtf file='c:\temp\big5.rtf' style=sasweb;
ods pdf file='c:\temp\big5.pdf' style=sasweb;

proc report data=sashelp.class nowd;
column name age height;
define name / display;
define age /display;
define height / display;
compute name;
obsno + 1;
if obsno = 5 then do;
call define (_ROW_,'style',
'style={font_size=16pt font_weight=bold}');
end;
endcomp;
run;

ods _all_ close;

[/pre]

Making the cell height higher is also possible -- at least for HTML and RTF by changing the CALL DEFINE statement (Note that each destination uses a different unit of measure):
HTML:
[pre]
call define(_ROW_,'style',
'style={cellheight=50px vjust=m}');
[/pre]

RTF:
[pre]
call define(_ROW_,'style',
'style={cellheight=.85in vjust=m}');
[/pre]

I found that I could not make cellheight in PDF higher in the middle of a table using the cellheight attribute. I don't know if this is an Adobe limitation or not. You could insert some ODS ESCAPECHAR line feeds into the NAME value in PDF in order to make the whole row higher. And, there are alternate methods in HTML to make font and other changes, using CSS style selectors (as opposed to ODS style= overrides, that are shown above).

In addition, with PROC REPORT, you could also pre-process the data and make a "dummy" break variable that occurred just on observation #5 -- but entails a bit more data step processing.

As you see, the answer really does depend on your destination and what you mean by wider. For more help with this question, your best bet is to contact Tech Support, as they can assess your report requirements and determine what your destination of interest is and help you come up with the best technique to achieve what you want to achieve.

cynthia
deleted_user
Not applicable
thank you for your answer cynthia but what i want to do is this :
with a proc report to change the width of the drawing line after a particular name in my table ( the thickness of a drawing line for only a line in my table)
I hope that you will understant what i mean.
@+
Cynthia_sas
SAS Super FREQ
Hi:
I really think this may be a question for Tech Support. I have a hard time envisioning what you mean by "drawing line" -- if you mean the line that is written by HEADLINE, DOL, DUL, OL, or UL -- those are LISTING only features. So, I'm also having trouble with the idea of changing the width of those lines.

To me the WIDTH of the LINE is how long the line is from left to right on the page -- and you say you want to change the width of the line that appears AFTER a particular name (variable?) in the table. Do you mean that you want to ADD a line or make a line longer? Or do you mean you want to make a line thicker or darker?

By AFTER do you mean UNDER, like the kind of line that might be under a PROC REPORT summary line? Sometimes when people talk about changing the characters used to draw lines in SAS, they change the FORMCHAR option -- this is most frequently done with PROC TABULATE for the LISTING window, so that TABULATE draws lines with characters that are available in most font sets. But FORMCHAR has nothing to do with the WIDTH of the line.

The only other lines that I can think of are the interior table lines and border around the table when you are sending output to ODS HTML, RTF or PDF.

When you call Tech Support for help, it will be most useful for them to have some idea of the following items:
1) what is your destination of choice (LISTING, RTF, PDF, HTML)
2) what code are you using to generate the current report
3) what piece of output on the current report you want to change.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 3 replies
  • 1841 views
  • 0 likes
  • 2 in conversation