Hello,
I am creating ODS RTF output that is going into a MS Word document. I need my output to be in Arial and 9pt font format. I have no issues when using gchart or gplot procedures. When I use sgplot or any other 'sg' procedure, my output doesn't reflex the change in font. I need my font to stay Arial, 9pt. What am I missing?
Here is my SAS code:
/* set font as Arial and 9pt */
goptions ftext= '<ttf> Arial Unicode MS' htext=9pt;
ODS GRAPHICS ON /
ATTRPRIORITY= NONE
BORDER = OFF
OUTPUTFMT = EMF
SCALE = OFF
HEIGHT = 4IN
WIDTH = 7IN;
OPTIONS PAPERSIZE= LETTER LEFTMARGIN = 1.9CM RIGHTMARGIN = 1.9CM;
ODS RTF FILE="PATH ENTERED HERE" startpage = NO;
PROC SGPANEL DATA=WORK.INPUT;
PANELBY AGE_GRPS /
NOVARNAME
LAYOUT=ROWLATTICE
ONEPANEL
NOBORDER
NOHEADER
NOHEADERBORDER
UNISCALE=COLUMN;
VLINE YEAR / RESPONSE=RATE ;
ROWAXIS
DISPLAY= (NOLINE NOTICKS)
VALUEATTRS= (FAMILY= ARIAL SIZE= 9PT)
colorbands=odd
colorbandsattrs= (COLOR=CXA5ACB0);
COLAXIS
VALUEATTRS= (FAMILY= ARIAL SIZE= 9PT) ;
RUN;
ODS GRAPHICS OFF;
ODS RTF CLOSE;
RUN;
QUIT;
Here's what it looks like in my MS Word document:
I am losing all my customized colours and fonts.
Once again, I don't have any issue when using proc gchart or proc gplot.
Any assistance would be appreciated.
Any chance that you are running this in EG or SAS Studio? And if so, have you turned off all of the other output destinations? If you had ODS HTML5 set, for example, with its own style, this could influence the look of your RTF content when that's used at the same time.
You can use EG or SAS Studio options to turn off all of the other destinations, or use ODS _ALL_ CLOSE before your code.
Any chance that you are running this in EG or SAS Studio? And if so, have you turned off all of the other output destinations? If you had ODS HTML5 set, for example, with its own style, this could influence the look of your RTF content when that's used at the same time.
You can use EG or SAS Studio options to turn off all of the other destinations, or use ODS _ALL_ CLOSE before your code.
You need "outputfmt=png" option of ODS GRAPHICS
and "style=htmlblue " option of ODS RTF.
ODS RTF FILE="c:\temp\temp.rtf" startpage = NO style=htmlblue dpi=300 ;
ODS GRAPHICS ON /
ATTRPRIORITY= NONE
BORDER = OFF
SCALE = OFF
HEIGHT = 4IN
WIDTH = 7IN
outputfmt=png ;
OPTIONS PAPERSIZE= LETTER LEFTMARGIN = 1.9CM RIGHTMARGIN = 1.9CM;
PROC SGPANEL DATA=sashelp.stocks;
PANELBY stock /
NOVARNAME
LAYOUT=ROWLATTICE
ONEPANEL
NOBORDER
NOHEADER
NOHEADERBORDER
UNISCALE=COLUMN;
format date year4.;
VLINE date / RESPONSE=close ;
ROWAXIS
DISPLAY= (NOLINE NOTICKS)
VALUEATTRS= (FAMILY= ARIAL SIZE= 9PT)
colorbands=odd
colorbandsattrs= (COLOR=CXA5ACB0);
COLAXIS
VALUEATTRS= (FAMILY= ARIAL SIZE= 9PT) ;
RUN;
ODS RTF CLOSE;
Thanks Ksharp. This worked!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: