The SAS Output Delivery System and reporting techniques

ODS rtf contents

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 88
Accepted Solution

ODS rtf contents

In the ods rtf output, I want to include contents inside.

below is my code and I got output like this:

Actually I only want to keep red marked part. I want to replace the blue marked text, using "Contents" instead of  "Table of contents"

In addition, I want to change the font size and style of contents.

How can I revise my code?

 

Thanks

 

try.JPG

 


ods rtf file='XXXXX\try.rtf' contents=yes toc_data bodytitle;

options nobyline;

proc sort data=sashelp.class out=class; by sex; run;
proc report data=class nowindows contents='table1: aaaaaaaaa';
column name sex age height weight;
by sex;
footnote 'Measurements are in metric tons.';
run;

proc report data=class nowindows contents='table2: bbbbbb';
column name sex age height weight;
by sex;
footnote 'Measurements are in metric tons.';
run;
ods rtf close;

 

 


Accepted Solutions
Solution
a week ago
SAS Super FREQ
Posts: 8,819

Re: ODS rtf contents

Hi:

  That extra "Table 1" node is something that PROC REPORT introduces. To get rid of that, you have to use a technique from this Tech Support note: http://support.sas.com/kb/31/278.html. 

 

  To do without the BY groups, you'd have to actually NOT use the BY statement. You could move to using PAGE instead of BY with PROC REPORT. But that means one of your variables (most likely SEX) for this scenario has to be a GROUP or ORDER variable.

 

  Also, ODS PROCLABEL will get rid of the "top" node in the table of contents.

 

  Here's something I mocked up -- program and output shown below.

 

cynthia

 

proc_report_revise_toc.png

View solution in original post


All Replies
SAS Super FREQ
Posts: 8,819

Re: ODS rtf contents

Hi:
Your report has by group processing turned on -- so you are getting contents for every BY group. Your highlighting implies that you want to see the contents only for the F bygroup, but not for the M bygroup? Is this correct?

cynthia
Frequent Contributor
Posts: 88

Re: ODS rtf contents

[ Edited ]

When you open the figure attached. You can see 'Table 1' index , I do not want the "Table 1".  

I only want to keep The index of "Table 1: aaaaaaaaaaaa" and 'Table 2: bbbbbbbbbbbbbbbbbbbbbbb'.

If you have a method to control the display of "F bygroup" and suppress the 'M bygroup' it will be great.

 

Solution
a week ago
SAS Super FREQ
Posts: 8,819

Re: ODS rtf contents

Hi:

  That extra "Table 1" node is something that PROC REPORT introduces. To get rid of that, you have to use a technique from this Tech Support note: http://support.sas.com/kb/31/278.html. 

 

  To do without the BY groups, you'd have to actually NOT use the BY statement. You could move to using PAGE instead of BY with PROC REPORT. But that means one of your variables (most likely SEX) for this scenario has to be a GROUP or ORDER variable.

 

  Also, ODS PROCLABEL will get rid of the "top" node in the table of contents.

 

  Here's something I mocked up -- program and output shown below.

 

cynthia

 

proc_report_revise_toc.png

Frequent Contributor
Posts: 88

Re: ODS rtf contents

Thanks a lot.

 

I can not open the link ' http://support.sas.com/kb/31/278.html. '  Can you please send me the file?

☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 204 views
  • 0 likes
  • 2 in conversation