The SAS Output Delivery System and reporting techniques

Left align charts with tagsets.rtf

Accepted Solution Solved
Reply
Occasional Contributor jb3
Occasional Contributor
Posts: 15
Accepted Solution

Left align charts with tagsets.rtf

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;

 

 

 


Accepted Solutions
Solution
‎10-15-2015 02:18 AM
SAS Super FREQ
Posts: 682

Re: Left align charts with tagsets.rtf

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


All Replies
SAS Super FREQ
Posts: 8,742

Re: Left align charts with tagsets.rtf

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
Solution
‎10-15-2015 02:18 AM
SAS Super FREQ
Posts: 682

Re: Left align charts with tagsets.rtf

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1875 views
  • 2 likes
  • 3 in conversation