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.

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.

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.

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.
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!

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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