Hi There,
I was trying to create a RTF file with below code. I'd like to put two titles on the same line. one with just=left, the other one with just=right.
However, it doesn't work in my program with bodytitle option was specified.
ODS RTF FILE= "X:\temp\myfile.rtf" style=styles.threelines keepn startpage=YES bodytitle;
title1 j=l "Company" j=r "Page x of N";
title2 "My title";
PROC REPORT DATA=rep NOWD HEADLINE HEADSKIP SPLIT='#' SPACING=1 MISSING
style(lines) = [ borderbottomcolor=white];
column txt ("_Total" ob cfb);
define txt / style(header)=[just=left asis=on]
style(column)=[just=left asis=on cellwidth=30% ] 'Visit';
define ob / style(header)=[just=center asis=on bordertopcolor=black bordertopwidth=0.5pt]
style(column)=[vjust=top just=center cellwidth=33% ]
"Observed" ;
define cfb / style(header)=[just=center asis=on bordertopcolor=black bordertopwidth=0.5pt]
style(column)=[vjust=top just=center cellwidth=33% ]
"CFB" ;
COMPUTE AFTER _PAGE_/ LEFT;
LINE @1 "Program: temp.sas Created on: &sysdate9.";
ENDCOMP;
run;
The report procedue works well, except for the title1, two titles aligns at right.
Anyone can help me on this? Thanks!
Thanks for providing your suggestion.
Finally, I got this resolved by ODS RTF with bodytitle_aux option.
Subject updated: "Titles alignments in ODS RTF with bodytitle"
Have a look at this SAS Note https://support.sas.com/kb/13/608.html and see if this helps.
Hi Burno,
Thanks for your help.
Is there a corresponding option of KEEPN in ods.tagsets?
As far as I know, this option does not exist for tagsets.rtf. You can display all the options available for tagsets.ods like so:
ods tagsets.rtf file= "c:\temp\myfile.rtf" options( doc="help");
ods tagsets.rtf close;
Also tagsets.ods does the "measurements" differently, so maybe KEEPN is not necessary.
Or you coould try this workaround way.
ODS RTF FILE= "C:\temp\myfile.rtf" style=journal bodytitle; ods escapechar='~'; title1 "Company %sysfunc(repeat(~_,100)) Page x of N"; title2 "My title"; PROC REPORT DATA=sashelp.class NOWD; run; ods rtf close;
Thanks for providing your suggestion.
Finally, I got this resolved by ODS RTF with bodytitle_aux option.
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.
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.