Dear All,
I am using proc report to generate RTF tables and I am facing a problem where the footer section of the RTF file section break size is 12pt and I want it to be 9pt. For some reason the header section is fine and coming as 9pt. but in the footer section it is coming as 12pt.
The ODS statements below is used to generate the RTF files.
ods rtf file="C:\myfolder\myfilename.rtf" bookmark = "xyz.mrk" style = mystyle; ods tagsets.default file=outxml(url=none) gpath="output path";
I am also using Proc Template code to set font sizes etc..
Proc template code:
ODS PATH ODSTEMP.CORE(UPDATE); PROC TEMPLATE; DEFINE STYLE CORE; /* name of new style */ PARENT=STYLES.RTF; /* inherit characteristics from existing style*/ /* change the below characteristics from the parent style */ /* specify typeface, font size, font weight (e.g., bold, bold italic, etc.)*/ REPLACE FONTS / 'titlefont2' = ("Times New Roman", 9pt) /* Procedure titles ("The ___ Procedure") */ 'titlefont' = ("Times New Roman", 9pt) /* Titles from TITLE statements */ 'Strongfont' = ("Times New Roman", 9pt) /* Strong (more emphasized table headings and footers, page numbers */ 'EmphasisFont' = ("Times New Roman", 9pt) /* titles for table of contents and table of pages, emphasized table headings and footers */ 'FixedEmphasisFont' = ("Times New Roman", 2pt) 'FixedStrongFont' = ("Times New Roman", 2pt) 'FixedHeadingFont' = ("Times New Roman", 2pt) 'BatchFixedFont' = ("SAS Monospace,Times New Roman", 2pt) 'FixedFont' = ("Times New Roman", 2pt) 'headingEmphasisFont' = ("Times New Roman", 9pt) 'headingFont' = ("Times New Roman", 9pt) /* Table column headings */ 'docFont' = ("Times New Roman", 9pt) /* Data in table cells */ 'footFont' = ("Times New Roman", 9pt) /* Footnotes from FOOTNOTE statements */ ; /* controls the headers of a table */ REPLACE HEADER / rules = none /* internal borders: none, all, cols, rows, groups */ frame = void /* outside borders: void, box, above/below, vsides/hsides, lhs/rhs */ font = fonts('HeadingFont') ; /* set up the page margins */ REPLACE BODY from DOCUMENT "Controls the Body file. " / bottommargin = 1in topmargin = 1in rightmargin = 1in leftmargin = 1in ; /* controls table headers and footers */; REPLACE HEADERSANDFOOTERS from CELL / font=fonts('HeadingFont') foreground=black background=white ; /* controls overall table syle */ STYLE TABLE from TABLE /rules = groups /* internal borders: none, all, cols, rows, groups */ frame = hsides /* outside borders: void, box, above/below, vsides/hsides, lhs/rhs */ cellspacing = 0pt /* the space between table cells, allows background to show */ cellpadding = 1.0pt /* the space between table cell contents and the cell border */ borderwidth = 0.5pt /* the width of the borders and rules */ protectspecialchars = off /* determine how less-than signs (<), greater-than signs (>) and ampersands (&) are interpreted */ ; STYLE DATA from CELL / cellpadding = 0pt /* the space between table cells, allows background to show */ cellspacing = 0pt /* the space between table cell contents and the cell border */ protectspecialchars = off /* determine how less-than signs (<), greater-than signs (>) and ampersands (&) are interpreted */ nobreakspace = off ; STYLE DATA from OUTPUT / cellpadding = 0pt /* the space between table cells, allows background to show */ cellspacing = 0pt /* the space between table cell contents and the cell border */ protectspecialchars = off /* determine how less-than signs (<), greater-than signs (>) and ampersands (&) are interpreted */ nobreakspace = off ; STYLE BODY from BODY / asis=on protectspecialchars = off ; /* controls the body file */ STYLE HEADER from HEADER / asis=on protectspecialchars = off ; /* controls the headers of a table */ STYLE SYSTEMTITLE from SYSTEMTITLE / asis=on protectspecialchars = off ; /* controls system title text */ STYLE SYSTEMFOOTER from SYSTEMFOOTER / asis=on protectspecialchars = off ; /* controls system footer text */ STYLE PARSKIP / fontsize = 0.1pt; END ; /* End the DEFINE statement*/; RUN;
I have inserted a screenshot of the section breaks I am talking about
Any help will be much appreciated.
Cheers Brian.
The code to generate the output looks like what? Especially the stuff going into the footer.
From the column headings I strongly suspect you may be using someones macro code to generate the table and that macro code may have statements over-riding the default style settings. If you are using a macro then post the code for that.
Hi Ballardw,
The code that I am using to generate the rtf:
%*<---
Titles and Footnotes
----------------------->;
title1 justify=l font="Times New Roman" height=9pt " ";
title2 justify=c font="Times New Roman" height=9pt "Table 1";
footnote1 justify=l font="Times New Roman" height=9pt "Program: t-enrol.sas"
justify=c font="Times New Roman" height=9pt "Table Generation: &datenow. &timenow."
justify=r font="Times New Roman" height=9pt "Page &esc.{pageof}";
%*<---
ODS Properties
----------------->;
options orientation=landscape nobyline;
ods listing close;
ods rtf file="C:\myfolder\myfilename.rtf" bookmark = "xyz.mrk" style = mystyle;
ods escapechar="&esc." ;
ods tagsets.default file=outxml(url=none) gpath="output path";
proc report data=all headline nowd spacing=2 center headskip split='#' formchar(2)='_' missing
out=report(where=(_break_='')) style(report)=[outputwidth=100.4%] style(column)=[just=c];
column (p ord order1 text1 _1 _2 _3 _4 _5 _99);
define p / order noprint;
define ord / order order=internal noprint;
define order1 / order order=internal noprint;
define text1 / order id display 'Category' style(column)= [cellwidth=132pt just=l asis=on] style(header)=[just=l asis=on];
define _1 / display "Treatment A" style(column)=[cellwidth=50.8pt just=c];
define _2 / display "Treatment B" style(column)=[cellwidth=50.8pt just=c];
define _3 / display "Treatment C" style(column)=[cellwidth=50.8pt just=c];
define _4 / display "Treatment D" style(column)=[cellwidth=50.8pt just=c];
define _5 / display "Treatment E" style(column)=[cellwidth=50.8pt just=c];
define _99 / display "Overall" style(column)=[cellwidth=50.8pt just=c];
break after p / page;
compute before p;
line @1 ' ';
endcomp;
compute after ord;
line @1 ' ';
endcomp;
run;
ods tagsets.default close;
ods rtf close ;
ods listing ;
Cheers B.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.