Given a table such as the following.
data Testing;
input Groups $ Var1 $ Var2 Var3;
datalines;
Group1 ABC 2.22 1.12
Group1 BCD 1.11 2.11
Group1 CDE 2.01 1.13
Group2 XYZ 3.21 1.01
Group2 WXY 4.22 0.01
Group2 VWX 5.05 1.05
Group3 JKL 1.12 2.11
Group3 LKJ 6.66 5.55
;
Using ODS Tagsets.RTF and proc report I generate this output:
via this code:
proc sort data=Testing;
by Groups;
run;
data Testing;
set Testing;
by Groups;
if last.Groups = 0 then ID = 1;
if (last.Groups = 1) AND (First.Groups = 1) then ID = 1;
if (last.Groups = 0) AND (First.Groups = 0) then ID = 0;
ODS Tagsets.RTF File = "&FilePath.\&FileName..rtf";
proc report data=Testing spanrows
Style(Report)=[Frame=HSides rules=cols];
Columns
ID Groups Var1 Var2 Var3;
Define ID / display noprint;
define Groups / group
Style(Column)=[vjust=c just=c];
define Var1 / display;
define Var2 / display;
define Var3 / display;
Compute Var1;
if ID = 1 then call define(_ROW_,'Style','Style=[bordertopwidth=0.1pt bordertopcolor=black]');
endcomp;
run;
ODS Tagsets.RTF Close;
I am generating similar tables for others to insert into a docx document, and i do not know the final dimensions such tables will need to take. I assumed the tables would be easily manipulated in the RTF file to get them into the correct dimensions (changing column widths, etc.) but i was mistaken.
If i try to manually click and drag any of the interior column borders, to expand or contract a column, the spanrows aspect collapses.
If i manually click and drag an outer vertical frame, the spanrows collapses, and the table offsets some of the rows.
is there a way to manually adjust the size of the table, and individual columns without collapsing the spanrows? And what is going on with the offsetting of some of the rows?
Is any of this avoidable?
... View more