BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have again ( i am sorry 🙂 ) another question :
i have this code :

data example;
analisys=100;second=1000;third='ex1';number=100;output;
analisys=200;second=2000;third='ex1';number=200;output;
analisys=300;second=1000;third='ex2';number=300;output;
analisys=400;second=2000;third='ex2';number=400;output;
run;

ods rtf file="C:\Documents and Settings\All Users\Documents\image2.rtf" bodytitle startpage=no;
ods escapechar="^";
title j=c "^S={preimage='C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\winter.jpg'}";

proc report data=example missing nowindows ;

column third second,( analisys number);
define third / group 'third';
define second / display across 'second';
define analisys /analysis '' ;
define number / analysis '';

rbreak after / summarize;
run;

ods rtf close;

but the image and the table are separated by one blank line.
so i want to know how can i control it ?
what can i do if i want that my picture and my table are not separated (without a blank line ) ?
and what i have to do to have 5 blanks lines instead of only one ?
and if i want that my picture and the top of the sheet are spaced by 5 blanks lines
how can i do without using the proc template ?
(because i fear that if i define a proc template with a topmargin of 5 cm to quote an example and that my report is 10 pages long and that i want a top margin of 5 cm only with the page with the picture it won't be OK ....)
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Reducing the space between the title and the table is harder than increasing the space. Here are some methods to increase the space (used a shorter path and image name in the code):

-- You can use ODS ESCAPECHAR to insert line breaks or carriage returns between the picture and the table. For example, you already set ODS ESCAPECHAR to '^' -- and use the ESCAPECHAR to set the preimage value. if you specified ^n, then that sequence means "line feed" or "carriage return". If you specifed ^_ (Escapechar+underscore) than that would insert a non-breaking space into the line or text.

So, for example this title statement:
[pre]
ods rtf file="C:\temp\image2.rtf" bodytitle startpage=no;
ods escapechar="^";
title j=c "^S={preimage='C:\temp\blue_frog.jpg'} ^n^_^n^_^n^_^n^_^n";
[/pre]

would insert 5 line feeds and a non-breaking space on every line between the title line and the table. Then if you changed your style to affect the margins of the document, you wouldn't have to worry about setting a different margin for page 1.

You could also use this technique to get a few lines above the image and lines below as well:
[pre]
title1 " ";
title2 " ";
title3 j=c "^S={preimage='C:\temp\blue_frog.jpg'}";
title4 " ";
title5 " ";
[/pre]

To REDUCE the space between the image and the table, you'd have to investigate the PARSKIP style element that is coming for SAS 9.2 -- it says on this web site
http://support.sas.com/rnd/base/new92/92measuredrtf.html
that using the new "measured" RTF in SAS 9.2 will give you a way to change the font of the paragraph spacing -- thus setting a small font would reduce the space.
Note in the example that TAGSETS.RTF is being used. This is the new "measured" RTF destination that generates a slightly different set of RTF control strings for the RTF document. I do not know whether the PARSKIP element will work with "classic" ODS RTF. But at any rate, it's coming in 9.2 and not of much help to you now.

For more help with your style template for RTF or style element overrides, you might consider contacting Tech Support.

cynthia

sas-innovate-2024.png

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.

 

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
  • 1 reply
  • 551 views
  • 0 likes
  • 2 in conversation