Date: Fri, 13 Aug 2010 17:38:38 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
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?
Content-Type: text/plain; charset=ISO-8859-1
Hi Paul,
To change to size of whole table you can override the default style:
obj.table_start(overrides: "width=6in");
obj.head_start();
obj.row_start();
obj.format_cell(data: "Name",overrides: "width=2in");
You can do it for the table_start to control the overall size,
you can also control each column size by adding the overrides
to the formar_cell.
The above make the overall table 6 in wide and first column 2 in wide
Thanks
Ya
On Fri, 13 Aug 2010 14:31:18 -0700, Paul Miller <pjmiller_57@YAHOO.COM>
wrote:
>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
>>
>>
>>
>
|