Help using Base SAS procedures

RTF Control Word --> Use of brdrl and brdrr ~ PLEASE HELP!! ~

Reply
N/A
Posts: 0

RTF Control Word --> Use of brdrl and brdrr ~ PLEASE HELP!! ~

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
Super Contributor
Posts: 260

Re: RTF Control Word --> Use of brdrl and brdrr ~ PLEASE HELP!! ~

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
SAS Super FREQ
Posts: 8,743

Re: RTF Control Word --> Use of brdrl and brdrr ~ PLEASE HELP!! ~

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]
N/A
Posts: 0

Re: RTF Control Word --> Use of brdrl and brdrr ~ PLEASE HELP!! ~

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
SAS Super FREQ
Posts: 8,743

Re: RTF Control Word --> Use of brdrl and brdrr ~ PLEASE HELP!! ~

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
Ask a Question
Discussion stats
  • 4 replies
  • 269 views
  • 0 likes
  • 3 in conversation