Data visualization with SAS programming

ODS RTF/TAGSETS.RTF: all in a row

Reply
Contributor
Posts: 29

ODS RTF/TAGSETS.RTF: all in a row

Hello, I have a problem: I would like to create a pretty report with different tables but I found that, with RTF, the space between each table was too big. So I searched on the net and I found that tagsets.rtf can be a solution. The problem now is that there is an automatic pagebreak that I cannot control as you can see in the picture below. How can I avoid that? Or exists it another alternative (paramter that I do not know with RTF,...)?

 

http://www.noelshack.com/2015-51-1450255506-image.jpg

 

Yhanks for yout time! Smiley Happy

Super User
Super User
Posts: 7,691

Re: ODS RTF/TAGSETS.RTF: all in a row

Hi,

 

Sorry, I can't really see that image.  Post some sample code as to what you have tried, principally the"space" you are having a problem with.  This is one of two things, your style - i.e. te template you are using to output the data, or secondly the renderer you are using.  RTF is plain text marked up with tags.  You use a renderer to render the text, so Word for example opens and processes the tags to give a document.  This rendering process is affected by the Word program and may not be the same across systems/software and can be affected by application settings.  Without some further information however (example code using sashelp dataset) I can't really say.

Contributor
Posts: 29

Re: ODS RTF/TAGSETS.RTF: all in a row

This below is an exemple of code. There is a page break at the start of page 2 that I do not want and with a longer text it repeat again. I don't have any problems without the lines "Title;" to the last "tagsets.rtf text=..." but I do not want a title each page. Thanks.

 

 ods listing close;

  proc template;
     define style test2;
     parent=styles.rtf;
        style parskip / fontsize = 5pt;
     end;
  run;

  data temp; do i = 1 to 70; output; end; run;

  ods tagsets.rtf file="mparskip.rtf" OPTIONS(SECT="NONE") STARTPAGE=NO style=test2;
   ods graphics on /
	height=8cm
	width=18cm
	border=off;
ods escapechar="^";
options center nonumber rightmargin = 1.00in leftmargin = 1.00in;
Title;
ods tagsets.rtf text='Text A';
ods tagsets.rtf text="^S={font=('Arial',24pt, bold) color=white}.^n^S={font=('Arial',12pt, bold)}T E X T   B^n";
ods tagsets.rtf text="^S={font=('Arial',12pt, bold)}Text ^S={font=('Arial',12pt, light)}^S={font=('Arial',12pt, light) color=red}C^S={font=('Arial',12pt, light)}";
ods tagsets.rtf text="^n^S={font=('Arial',12pt)}_____________________________________________________________________^n^S={font=('Arial',12pt) color=white}.";
ods tagsets.rtf text="^S={font=('Arial',12pt, bold italic) textdecoration=underline}Text D";
ods tagsets.rtf text="^S={font=('Arial',12pt) color=white}. ^n^S={font=('Arial',12pt, bold)}Text^S={font=('Arial',12pt, light)}E^n^S={font=('Calibri',4pt) color=white}.";

proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;
proc print data=sashelp.class (obs=5); run;


  ods _all_ close;
Super User
Super User
Posts: 7,691

Re: ODS RTF/TAGSETS.RTF: all in a row

Hi,


Well, I haven't used ods tagsets.rtf, I always tend to use ods rtf (which is likely the same thing now, but I know the tagsets were still development a while back).  This works fine on my machine:

ods rtf file="s:\temp\rob\test.rtf" startpage=no;
proc report data=sashelp.class;
  columns _all_;
run;
proc report data=sashelp.class;
  columns _all_;
run;
ods rtf close;

So maybe try adding each extra part you have in one by one, as it could be the ods text you are adding in which is causing page breaking.  Also, I would use proc report, its just that bit more flexible.

Contributor
Posts: 29

Re: ODS RTF/TAGSETS.RTF: all in a row

 

Yes, but as you can see in the picture below, with ods rtf I have two problems:

 

http://www.noelshack.com/2015-51-1450430543-img1.png

 

* Big header in Word

* The space remains important because I print my title for my tables with a proc report. I have a two tables with a common key. One table concerns the titles ([NB...]) and the second the data

 

I can remove the header with bodytitle option but so parksip has no more effect.

 

Is it possible to reduce (or remove) the size of the footnote of a proc report ? I think the place is reserved even I don't use footnote at all.

 

I'm sad that ods tagsets.rtf resolve some problems of ods rtf but create new ones (or the opposit) Smiley Sad I'm open to any idea, even tricks! 

Super User
Super User
Posts: 7,691

Re: ODS RTF/TAGSETS.RTF: all in a row

You can alter any part of the output by using styles, for instance to change a title style:

title1 j=r f='Sas Monospace' h=8pt "Title";

So in the above I justify to the right, set the font, and set height to 8pt.

You can modify any style in proc report or the statement, or you can setup a template or modify an existing one.

 

I am not sure what "problems" you have had with ods rtf?  The RTF markup is designed by Microsoft quite some time ago, its pretty useful for output as a word type file, but do remember it hasn't been updated in quite a while.  

Contributor
Posts: 29

Re: ODS RTF/TAGSETS.RTF: all in a row

I assume that my problems are just details but I would like to have a report - as much as possible - surgical.

 

I analyzed what is built from our codes: there are always two lines between two reports. These two lines have always the same font and the same font size than the text of the previous table. In the case of using the first one as title of the second one, I find that two lines are to much, and in order to reduce the font size of these two lines to gain space, I have to reduce the font size of the "report tile" and it does not suit me of course.

 

The second problem are title automatically included in Word headers and for a obscure reason bodytitle add more extra space between reports. However, this problem is for me less important that the first one.

 

 

Ask a Question
Discussion stats
  • 6 replies
  • 609 views
  • 0 likes
  • 2 in conversation