ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Coooooo_Lee
Obsidian | Level 7

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Coooooo_Lee
Obsidian | Level 7

Thanks for providing your suggestion.

Finally, I got this resolved by ODS RTF with bodytitle_aux option.

 

 

View solution in original post

7 REPLIES 7
Coooooo_Lee
Obsidian | Level 7

Subject updated: "Titles alignments in ODS RTF with bodytitle"

BrunoMueller
SAS Super FREQ

Have a look at this SAS Note https://support.sas.com/kb/13/608.html and see if this helps.

Coooooo_Lee
Obsidian | Level 7

Hi Burno,

 

Thanks for your help.

Is there a corresponding option of KEEPN in ods.tagsets?

BrunoMueller
SAS Super FREQ

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.

Ksharp
Super User

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;

Ksharp_0-1642507995102.png

 

Coooooo_Lee
Obsidian | Level 7

Thanks for providing your suggestion.

Finally, I got this resolved by ODS RTF with bodytitle_aux option.

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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