The SAS Output Delivery System and reporting techniques

How to get rid of empty line in ODS RTF output from proc report

Reply
Occasional Contributor
Posts: 17

How to get rid of empty line in ODS RTF output from proc report

Hi I would really appreciate if anyone can help on on this one. When I use proc report with ODS RTF, I see a blank line at the very end after the last row of table and before the footnote. This causes an empty page after proc report output, if on previous page table ends close to the end of page. Code at the end of this message can be used to reproduce the problem. I see SAS has following Note to address this or similar issue.

16976 - Blank page generated when ODS RTF file is opened in MS Word

But still suggested solution isn't practical for data driven reports. Instead there must be some other better way to resolve the problem. First it must be possible to get rid of empty row somehow. The row doesn't seem to have any purpose. Otherwise, other workaround can be to reduce the fontsize of that line to very small, e.g. with fontsize=1 for that line, the possibility of empty page will be greatly reduced. I played around with proc template but couldn't figure out which element applies to this line.

Please help me. I am sure this is very common problem and should have some easy solution.

options nonumber nodate ;

     ods rtf file= "C:\test.rtf" style= rtf;

OPTIONS FORMCHAR="|----|+|---+=|-/\<>*";

title1 'company name                      ';

footnote1 'dummy footnote';

options obs=42;

proc sort data=sashelp.cars out=cars;

   by origin make model;

run;

ods escapechar='^';

proc report data=cars nowd  missing;

   column (origin make model type ('Pricing' msrp invoice ) );

   define origin/order ; *id  STYLE={CELLWIDTH=3cm};

   define make/order STYLE={CELLWIDTH=3cm} ' Make of the car';

   define model/display  STYLE={CELLWIDTH=3cm};

run;

ods rtf close;

Grand Advisor
Posts: 9,748

Re: How to get rid of empty line in ODS RTF output from proc report

If you have SAS 9.4 using TAGSETS.RTF instead of straight ODS RTF add: options (vspace='no')

to the ODS TAGSETS.RTF statement may help.

Another approach is to modify a style and use that style with Tagsets.Rtf

  proc template;

     define style test1;

     parent=styles.rtf;

        style parskip / fontsize = 1pt; /* to make the space between very small*/

     end;

  run;

I have used this but ran into other differences between options with the tagsets, sometimes called 'measured', RTF and ODS RTF formatting that sometimes makes choosing between the differences a headache.

SAS Super FREQ
Posts: 8,645

Re: How to get rid of empty line in ODS RTF output from proc report

My rule of thumb is to use TAGSETS.RTF where I want Word to respect my SAS page breaks. I use "regular" RTF when I know that after the fact, somebody is going to combine all the separate RTF files into a bigger document, In this case, the page breaks are likely to change anyway, so the SAS page breaks are not as critical. TAGSETS.RTF does have some nice hooks and suboptions, though that are worth looking into.

cynthia

Occasional Contributor
Posts: 17

Re: How to get rid of empty line in ODS RTF output from proc report

Thanks ballardwballardw & Cynthia for quick help.

Vineet

Post a Question
Discussion Stats
  • 3 replies
  • 1408 views
  • 6 likes
  • 3 in conversation