BookmarkSubscribeRSS Feed
vineet7878_gmail_com
Obsidian | Level 7

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;

3 REPLIES 3
ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ

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

vineet7878_gmail_com
Obsidian | Level 7

Thanks ballardwballardw & Cynthia for quick help.

Vineet

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 4913 views
  • 6 likes
  • 3 in conversation