Date: Fri, 13 Aug 2010 14:31:18 -0700
Reply-To: Paul Miller <pjmiller_57@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Miller <pjmiller_57@YAHOO.COM>
Subject: Re: Proc Report and ODS RTF: Can I make 3 of 4 borders of a cell
invisable?
In-Reply-To: <201008131742.o7DHGXg2011383@willow.cc.uga.edu>
Content-Type: text/plain; charset=utf-8
Hi Ya,
This works quite well. At first, it looked like a lot of code but then I realilzed it's only slightly longer than my Proc Report code and actually produces the desired table.
I found a SUGI paper on the ODS Report Writing Interface and was able to use that and some common sense to get the table I wanted. The only thing I'd like to be able to do now is to adjust the column widths or the overall width of the table so that my table doesn't look so narrow. The paper I found mentions obj.region(). This may be what I need but I haven't been able to get it to work.
Can you show me how to adjust the table and column widths?
Thanks,
Paul
--- On Fri, 8/13/10, Ya Huang <ya.huang@AMYLIN.COM> wrote:
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: Proc Report and ODS RTF: Can I make 3 of 4 borders of a cell invisable?
To: SAS-L@LISTSERV.UGA.EDU, "Paul Miller" <pjmiller_57@YAHOO.COM>
Cc: "Ya Huang" <ya.huang@AMYLIN.COM>
Received: Friday, August 13, 2010, 12:42 PM
Paul,
If you don't mind try some new stuff, the "ODS Report Writing Interface"
is very powerful and can achieve your goal easily:
ods listing close;
ods rtf file="c:\temp\junk.rtf";
data _null_;
set sashelp.class end=eof;
if _n_=1 then do;
declare odsout obj();
obj.table_start();
obj.head_start();
obj.row_start();
obj.format_cell(data: "Name");
obj.format_cell(data: "Sex");
obj.format_cell(data: "Age");
obj.format_cell(data: "Weight");
obj.row_end();
obj.head_end();
end;
obj.row_start();
obj.format_cell(data: name);
obj.format_cell(data: sex);
obj.format_cell(data: age);
obj.format_cell(data: weight);
obj.row_end();
if eof then do;
obj.row_start();
obj.format_cell(data: "Note: Percents in the table are column
percents.",column_span:4);
obj.row_end();
obj.row_start();
obj.format_cell(data: "footnote blabla .....",column_span:4,
overrides:"just=l borderrightstyle=none borderbottomstyle=none
borderleftstyle=none");
obj.row_end();
obj.table_end();
end;
run;
ods _all_ close;
HTH
Ya
On Fri, 13 Aug 2010 07:22:14 -0700, Paul Miller <pjmiller_57@YAHOO.COM>
wrote:
>Hi Andre,
>?
>Thanks for your reply. Unfortunately, the code you sent doesn't do what I
need. It can be difficult sometimes to explain what you're trying to do,
and I don't think my question was stated clearly enough. Sorry about that.
>?
>The code you sent creates two rows within the same cell. What I want is
for each of the two rows to be in its own cell. Each cell would span the
width of the table. The borders on the first cell (the chi-square test
results) would be visable. The borders in the second cell (the footnote)
would be invisable.
>?
>Is there some way to get a table like this?
>?
>Thanks,
>?
>Paul
>?
>?
>
>
>--- On Fri, 8/13/10, Andre Wielki <wielki@ined.fr> wrote:
>
>
>From: Andre Wielki <wielki@ined.fr>
>Subject: Re: Proc Report and ODS RTF: Can I make 3 of 4 borders of a cell
invisable?
>To: "Paul Miller" <pjmiller_57@YAHOO.COM>, "SAS-L@LISTSERV.UGA.EDU" <SAS-
L@LISTSERV.UGA.EDU>
>Received: Friday, August 13, 2010, 6:21 AM
>
>
>Here a final one, Paul
>
>ods rtf file="d:\temp\test3.rtf";
>proc report data=sashelp.class nowd style(column)={cellwidth=2 cm};
>columns name age height weight;
>compute after _page_ / style = [font_size=9pt];
>line " ^{style [font_face=symbol]c}^{super 2}
>? ? ???^{style [font_face=courier]=(1,175)=0.94, p=0.33 }
>? ? ? ? ";
>line " ^{style [borderrightstyle=none borderbottomstyle=none
borderleftstyle=none]
>? ? ? ???Note: Percents in the table are column percents. }";
>line " ql ";
>endcomp;
>run;
>ods rtf close;
>
>Remark
>as the compute after is an entire? block
>the borders... rules are applying to the three lines
>
>you may glide them on the first line it works too!
>
>ods rtf file="d:\temp\test3.rtf";
>proc report data=sashelp.class nowd style(column)={cellwidth=2 cm};
>columns name age height weight;
>compute after _page_ / style = [font_size=9pt];
>line " ^{style? [borderrightstyle=none borderbottomstyle=none
borderleftstyle=none]
>? ? ???^{style [font_face=symbol]c}^{super 2}
>? ? ???^{style [font_face=courier]=(1,175)=0.94, p=0.33 }
>? ? ? ? }";
>line " Note: Percents in the table are column percents. ";
>line " ql ";
>endcomp;
>run;
>ods rtf close;
>
>
>Andre
>
>--? ? André —IELKI
>???INED (Institut National d'Etudes Dé¯graphiques)
>???Service Informatique
>???133 Boulevard Davout? ? ? 75980 Paris Cedex 20
>???mé¬ : wielki@ined.fr? ? ? té¬ :? 33 (0) 1 56 06 21 54
>
>
>
|