BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Lewinda
Fluorite | Level 6

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 is the output in SAS:
Lewinda_0-1720724838040.png

 

Here's what it looks like in my MS Word document:

Lewinda_1-1720725264987.png

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

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.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

View solution in original post

3 REPLIES 3
ChrisHemedinger
Community Manager

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.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
Ksharp
Super User

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;

 

Ksharp_0-1720746248175.png

 

Lewinda
Fluorite | Level 6

Thanks Ksharp.  This worked!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 618 views
  • 1 like
  • 3 in conversation