BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Dear all,

I'm currently using a proc report to produce statistical tables in RTF files.
I would like to put a vertical line on the left or right border of a specified column.

I tried to use the following code into my proc report, but unfortunately it didn't work!
define Group1 / DISPLAY style(column)={just=center protectspecialchars=off pretext='\brdrl\brdrs\brdrhair\brdrw10'} style(header)={just=center CellWidth=12%};

It will be very helpfull if someone could help me!
Thank You Very Much in advance,

Regards,

Violaine Message was edited by: hevio
4 REPLIES 4
Olivier
Pyrite | Level 9
Hi Violaine.

Could you please try this ?
If thought this was the correct syntax for in-line formatting...
[pre]
define Group1 / DISPLAY style(column)={just=center protectspecialchars=off pretext="(*ESC*)R'\brdrl\brdrs\brdrhair\brdrw10'"} style(header)={just=center CellWidth=12%};
[/pre]
Cheers.
Olivier
Cynthia_sas
SAS Super FREQ
Hi, Olivier & Violaine:

When I test with this program (in SAS 9.1.3), I do not need the special (*ESC*) to insert RAW text into RTF in order to get the control string to be used.

And, depending on what Violaine wants to do, she may or may not get what she wants out of using the RULES, CELLSPACING and FRAME style attributes in PROC REPORT -- without using RTF control strings.

[pre]
data testrtf;
set sashelp.class;
group1 = sex;
run;

ods rtf file='c:\temp\rtfstr.rtf';

proc report data=testrtf nowd
style(report)={rules=none cellspacing=0 frame=void};
column group1 height;
define Group1 / DISPLAY
style(column)={just=center protectspecialchars=off pretext='\brdrl\brdrs\brdrhair\brdrw10'}
style(header)={just=center};
define height / display;
run;
ods rtf close;

[/pre]

I DO get a line on the left side of the GROUP1 column. The reason I turn off all the interior lines that come from ODS (rules=none cellspacing=0 frame=void) is so I can SEE the line put there by the RTF control strings. However, once inside Word, I have to TURN off the display of the TABLE gridlines (Menu --> Table --> Hide Gridlines) and I also need to make sure that Show/Hide icon (Paragraph Mark) is not turned on. Or else all the Word gridlines interfere with seeing the line put there by the RTF control string.

However, if all you want is vertical lines at the sides of the table or between the columns, you can also do this in the proc report statement without using RTF control strings ... see the code examples below (run them in an ODS sandwich for RTF).

cynthia

[pre]
proc report data=testrtf nowd
style(report)={rules=none cellspacing=0 frame=vsides};
title 'With ODS Styles rules=none frame=vsides';
column group1 height;
define Group1 / DISPLAY
style(column)={just=center}
style(header)={just=center};
define height / display;
run;

proc report data=testrtf nowd
style(report)={rules=cols cellspacing=0 frame=vsides};
title 'With ODS Styles rules=cols frame=vsides';
column group1 height;
define Group1 / DISPLAY
style(column)={just=center}
style(header)={just=center};
define height / display;
run;

[/pre]
deleted_user
Not applicable
Thank You Very Much to both of you for your help.

I used the following SAS code, as proposed by Cynthia:
data testrtf;
set sashelp.class;
group1 = sex;
run;

ods rtf file='c:\temp\rtfstr1.rtf';
proc report data=testrtf nowd
style(report)={rules=none cellspacing=0 frame=void};
column group1 height;
define Group1 / DISPLAY
style(column)={just=center protectspecialchars=off pretext='\brdrl\brdrs\brdrhair\brdrw10'}
style(header)={just=center};
define height / display;
run;
ods rtf close;

But, it seems that the vertical line can't be draw without a minimal value into the option "cellpadding=". On the contrary, horizontal lines can be drawn when the option cellpadding=0.
What I would like is "drawn vertical lines" using the option cellpadding=0. Is it possible?

Thanks a lot,

Violaine
Cynthia_sas
SAS Super FREQ
Hi, Violaine:
I have tested the following:
[pre]
proc report data=testrtf nowd
style(report)={rules=none cellpadding=7 cellspacing=0 frame=void};

proc report data=testrtf nowd
style(report)={rules=none cellpadding=6 cellspacing=0 frame=void};

proc report data=testrtf nowd
style(report)={rules=none cellpadding=5 cellspacing=0 frame=void};

proc report data=testrtf nowd
style(report)={rules=none cellpadding=4 cellspacing=0 frame=void};

[/pre]

Cellpadding 4 or smaller resulted in the line not showing at all. There must be some violation of Microsoft's rules for a table. I can see that ODS has "sent" the string to Word, by looking at the RTF file with Notepad:
[pre]
{\brdrl\brdrs\brdrhair\brdrw10M\cell}

\pard\plain\intbl\sb38\sa38\qr\f1\fs20\cf1{69\cell}
{\row}
\trowd\trkeep\trqc\trgaph38
\cltxlrtb\clvertalt\cellx2641
\cltxlrtb\clvertalt\cellx3371
\pard\plain\intbl\sb38\sa38\qc\f1\fs20\cf1{\brdrl\brdrs\brdrhair\brdrw10F\cell}
[/pre]

I don't know whether it's worth getting into RTF issues with Tech Support. There may be a chance that the new TAGSETS.RTF in SAS 9.2 may help, but I suspect that it won't. Cellpadding and cellspacing were/are very common in the HTML world -- for a browser, HTML cellpadding has a default of 1 and cellspacing has a default of 2. I don't know whether there are any minimums for the equivalent controls in RTF.

By default, if you do not specify a unit of measure for cellpadding, the unit of measure is PIXELS...that was the unit of measure for the above test. You could specify the cellpadding in PTs (which in RTF would get translated to TWIPS --twentieths of a printers point) -- and so I also tested in PTs for CELLPADDING:

[pre]
proc report data=testrtf nowd
style(report)={rules=none cellpadding=2pt cellspacing=0 frame=void};
[/pre]

I tested from 0pt to 7pt as the value...at 2 pt, I got a line -- but at 0pt or 1pt, no line.

I'm not sure what you are trying to accomplish with cellpadding of 0 -- I do notice some little breaks in the vertical line with some of these values. I did NOT see them with a cellpadding of 6 pixels, but then I did see them with a cellpadding of 5 and 7. I always saw that little break in the line when I used PT size

There may be another RTF control string to do what you want, perhaps at the table level, but I haven't worked with RTF control strings all that much to know whether that's a possibility.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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