BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jb3
Obsidian | Level 7 jb3
Obsidian | Level 7

Hi all, 

 

I'd like to have all text, tables and charts left-aligned in an rtf file created with SAS (9.4M2 on Windows) ods tagsets.rtf. Using 'options nocenter;' all text aligned left as desired, but charts rendered using proc sgplot or proc gchart are still centered horizontally. How can I have the charts left-aligned in the rtf output?  

 

Thanks for your help!

 

Here's my code: 

 

 

options nocenter;
goptions device=ACTXIMG;

ods tagsets.rtf file='c:\Test-Left-Justify.rtf';
ods html file='c:\Test-Left-Justify.html';

title  Titletext left-adjusted;

proc sgplot data=sashelp.cars;
 vbar cylinders;
run;

proc gchart data=sashelp.cars;
 vbar cylinders;
run;

proc tabulate data=sashelp.cars;
 class make cylinders;
 table make, cylinders ;
run;

ods html close;
ods tagsets.rtf close;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

 

Seems like you can overcome this by creating your own style.

 

See the code sample below for creating the new style

 


ods path
  (prepend) work.myStuff (update)
;

proc template;
  define style rtf_gleft;
    parent=styles.rtf;
    class Graph  /
      just=left 
    ;
  end;
run;

ods tagsets.rtf file='c:\temp\Test-Left-Justify.rtf' style=rtf_gleft;

Might be a bug, since the Options NOCENTER shoud take care of that.

 

Bruno

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
I am not sure that what you want to do is possible. Here's the challenge: when an image is created for RTF or PDF output, the image is converted from the SAS "device" or image format to an internal RTF or PDF format -- because the image is actually embedded in the RTF or PDF document.

I think you may have to open a track with Tech Support on this question to get the definitive answer. For PDF, and SAS/GRAPH, I believe you could specific the HORIGIN and VORIGIN to adjust the location in the document, but that won't help you with RTF. And, for PDF, you could use ODS LAYOUT to place the image -- look at some of the examples in this paper http://support.sas.com/resources/papers/proceedings13/015-2013.pdf or in this paper: https://vasug.files.wordpress.com/2009/06/ods-layout.pdf or any other papers by Pete Lund, Barbara Okerson or Dan O'Connor.

RTF is more limited in the type of control you have over object placement and I believe that you will need help from the experts in Tech Support to find out whether it is possible and how.

cynthia
BrunoMueller
SAS Super FREQ

Hi

 

Seems like you can overcome this by creating your own style.

 

See the code sample below for creating the new style

 


ods path
  (prepend) work.myStuff (update)
;

proc template;
  define style rtf_gleft;
    parent=styles.rtf;
    class Graph  /
      just=left 
    ;
  end;
run;

ods tagsets.rtf file='c:\temp\Test-Left-Justify.rtf' style=rtf_gleft;

Might be a bug, since the Options NOCENTER shoud take care of that.

 

Bruno

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 4352 views
  • 2 likes
  • 3 in conversation