Date: Thu, 3 Jun 2004 11:36:04 -0400
Reply-To: Yu.Guo@VERISPAN.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Raymond G." <Yu.Guo@VERISPAN.COM>
Subject: Re: ODS RTF - Bold Columns - Please Help!!!!
Content-type: text/plain; charset=US-ASCII
Kirsty,
The attachment in the end is the code I used in my project. Please notice
the "compute *variable* ... " section, which controls BOLDing data in
cells. You could simply write like:
compute bold_var1;
call define(_col_, "style", "style=[font_weight=bold]" ); ** you can
bold the row by using define(_row_, ...);
endcomp
Good luck,
yu
------------------------
proc report data=dtRep_final noheader wrap missing nowindows &rep_contents.; *space=1;
**rep_contents : for handling bookmarks in PDF output;
column (
name1
count1_s
name2
count2_s );
**asis = on CELLWIDTH=0.8 in;
define name1 / display style=[cellwidth=2.6 in just=left] '';
define count1_s / display width = 15 style = [CELLWIDTH=0.8 in &_colStyle_ ] '';
define name2 / display style=[cellwidth=2.6 in just=left] '';
define count2_s / display width=15 style = [CELLWIDTH=0.8 in &_colStyle_ ] '';
** make chosen text to be BOLD. ;
** In this case, the chosen text have [bold] as prefix;
**TRICK:TRICK: could use _row_ to change style of a row;
compute name1;
if INDEX(name1, '[bold]') >0 then do;
call define(_col_, "style", "style=[font_weight=bold]" );
name1 = SUBSTR(name1, 7); ** remove the prefix [bold];
end;
endcomp;
compute name2;
if INDEX(name2, '[bold]') >0 then do;
call define(_col_, "style", "style=[font_weight=bold]" );
name2 = SUBSTR(name2, 7);
end;
endcomp;
Kirsty Lauderdale <kirsty.lauderdale@EUROPE.PPDI.COM>@LISTSERV.UGA.EDU> on
06/03/2004 09:31:07 AM
Please respond to Kirsty Lauderdale <kirsty.lauderdale@EUROPE.PPDI.COM>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
To: SAS-L@LISTSERV.UGA.EDU
cc:
Subject: ODS RTF - Bold Columns - Please Help!!!!
Hi
I was wondering if anyone had any advice on this....
I'm using SAS8.2, and am trying to produce a document that will look
like this;
Heading1 Heading2 Heading3
BOLD text text
text text text
I can get the headings bold and increase the font sizes, the problem I
appear to be having is with emboldening certain data in the "Heading1"
column. I have code that I believe will work but when I run it my MS
Word (97) freezes. I did notice the SAS help files does say there is a
problem with ODS taking a long time to output with 8.2 and is fixed in
V9 BUT there is a hotfix for 8.2 which I have applied to my machine.
Here's the code I'm using.... I think the bold is working but as I
can't see the word file I can't check it! If anyone could help I'd
really appreciate it!
Kirsty
LIBNAME kir "C:\Documents and Settings\lauderk\data_1\";
Options nofmterr ORIENTATION=LANDSCAPE NODATE NUMBER;
PROC TEMPLATE;
define style Styles.Kirsty;
parent=styles.rtf;
replace fonts/
'TitleFont2' =
("Arial",10.1pt,Bold) /*procedure titles
*/
'TitleFont' =
("Arial,",11.1pt,Bold) /*title */
'FootnoteFont'
=("Arial",10.1pt,Light) /*footnote */
'StrongFont'
=("Arial",11.1,Bold) /*page numbers*/
'EmphasisFont' = ("Arial",10.1pt,Bold)
'FixedEmphasisFont' = ("Arial",10.1pt,Bold)
'FixedStrongFont' = ("Arial",10.1pt,Bold)
'FixedHeadingFont' = ("Arial",10.1pt,Bold)
'BatchFixedFont' = ("Arial",10.1pt,Bold)
'FixedFont' = ("Arial",10.1pt)
'headingEmphasisFont' = ("Arial",10.1pt,Bold)
'headingFont'
=("Arial",10.1pt,Bold) /*table header*/
'docFont' = ("Arial",10.1pt,Light);
replace SystemFooter from TitlesAndFooters /
font= Fonts('FootnoteFont');
replace color_list
"Colors used in the default style" /
'link'= blue
'bgH'= white
'fg' = black
'bg' = white;
style Table from output /
Background=_UNDEF_
Rules=groups
Frame=void;
style Header from Header /
Background=_undef_;
style Rowheader from Rowheader /
Background=_undef_;
replace pageno from titlesandfooters/
Foreground=white;
END;
RUN;
**************************************************************
* Macro sets the 3 terms together, bolds the first one and indents the
other 2 *
*
*
* os1, os2, os3 = Variables, Res= New var name, Indent= indent
in *
**************************************************************;
%MACRO indent(os1=, os2=, os3=,res=, indent=0);
%local istring;
%let istring = %str(%')^R
%str(%")
\par\line&indent
%str(%")
%str(%')||;
&res='{\b ' ||trim(&os1) || '}' ||
%unquote(&istring)left(trim(&os2))||%unquote(&istring)
left(trim(&os3))|| '}';
&res = compbl(&res);
%mend indent;
DATA ds1 (KEEP= sortvar var1 var2 var3 newvar );
LENGTH res $500;
SET kir.datastet;
%indent(os1=var1, os2=var2, os3=var3, res=newvar, indent=12);
RUN;
PROC SORT DATA=ds1;
BY sortvar;
RUN;
DATA ds2;
SET ds1;
BY sortvar;
IF FIRST.sortvar THEN bold=1;
RUN;
DATA ds3;
LENGTH sortvar_a $20;
SET ds2;
BY sortvar;
IF bold=1 THEN sortvar_a=COMPBL('{\b '||sortvar|| '}');
RUN;
ODS RTF BODY='C:\Documents and Settings\lauderk\Desktop\temp.rtf'
style=Styles.Kirsty BODYTITLE;
TITLE ' This should be arial font 11 BOLD';
TITLE2 'All rest of text should be arial font 10 with headers in
bold';
TITLE3 .j=c "{\b\i PAGE }{\field {\*\fldinst {\b\i PAGE }}}\~{\b\i
of}\~{\field{\*\fldinst {\b\i NUMPAGES }}}";
FOOTNOTE1 j=l 'footnote1';
footnote3 j=l /*"Directory Structure"
||*/'{\field{\*\fldinst{\pard\b0\i0\chcbpat8\ql\fc\fs19\cf1{DATE \\@
"hh:mm MMMM dd, yyyy " }\cf0\chcbpat0}}}';
/* 9.5inches to a landscape page */
PROC REPORT DATA=tempc (OBS=5) NOWD HEADLINE HEADSKIP ;
COLUMN sortvar sortvar_a newvar;
DEFINE sortvar / GROUP ;
DEFINE sortvar_a / DISPLAY; *
This variable should be bold when output *;
DEFINE newvar / DISPLAY WIDTH=50 FLOW; *This var should be
bold and indented so runs
over 3 lines *;
RUN;
ODS RTF CLOSE;
Thank you!
_______________________________________________________
This e-mail transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient,
you are hereby notified that you must not read this transmission and that
any disclosure, copying, printing, distribution or use of this
transmission is strictly prohibited. If you have received this
transmission in error, please immediately notify the sender by telephone
or return email and delete the original transmission and its attachments
without reading or saving in any manner.