- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc template;
define style tfl_table;
style body /
leftmargin = 1in
rightmargin = 1in
topmargin = 0.5in
bottommargin = 0.5in;
style table /
frame = hsides
rules = groups
cellpadding = 3pt
cellspacing = 0pt
width = 100%;
style header /
/*This is the header line for the table.*/
fontfamily = 'Courier New'
fontsize = 9pt;
style data /
/*This is the data in the table.*/
fontfamily = 'Courier New'
fontsize = 9pt;
style SystemTitle /
fontfamily = 'Courier New'
color = red
fontsize = 10pt;
style systemfooter /
/*This affects the text in footnoteX statement.*/
textalign = left
fontfamily = 'Courier New'
fontsize = 9pt;
style NoteContent from Note /
/*change the font in the compute line*/
textalign = left
fontsize = 9pt
fontfamily = 'Courier New';
end;
run;
ods html close;
ods rtf file = "&dir.\test-run.rtf" bodytitle style = tfl_table;
ods escapechar = '^';
title1 'First Title with title1 statement';
title2 'Second Title with title2 statement';
footnote1 'footnote1 with footnote1 statement';
footnote2 'footnote2 with footnote2 statement';
proc report data = sashelp.class nowd;
column sex name age height weight;
define sex / group;
break after sex / page;
run;
ods rtf close;
title;
footnote;
I wrote a template to create table.. There are a few question: headers and footnotes are separated from the main table by a blank line or two. How can I remove the blank line between the footnotes and the main table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Only the footnotes and the space between the Title and the table?
The PARSKIP style attribute in the style template controls the default space between titles and footnotes.
You would have a line similar to
style parskip / fontsize = 1pt;
in your style template to have the space reduced to 1pt between the titles, footnote and the table.
Alternate, which doesn't allow quite the appearance options is to use the POSTTEXT style option.
proc report data=sashelp.class style=[posttext='something following'] ; columns name sex age; define sex/display; define age/display; run;
The Posttext, and the Pretext that would precede a table, does not have any persistence like title and footnote, does not incorporate many of the appearance options of title/ footnote and pretty much only allows one element, i.e. all the text goes in one posttext text content. But the text does appear immediately after/before the table.
I find Pretext/Posttext more helpful in Proc Tabulate which can create multiple tables as the style is applied per single table as an option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
ballardw,
When I using style=journal within RTF and got this weird result . Any idea ?
ods rtf file = "c:\temp\test-run.rtf" bodytitle style = journal ;
title;
footnote;
proc report data = sashelp.class nowd
style=[pretext='something following' posttext='something following' fontsize=6];
column sex name age height weight;
define sex / group;
break after sex / page;
run;
ods rtf close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
for tagset.rtf there is OPTIONS(vspace="NO"):
ods tagsets.rtf file = "&dir.\test-run.rtf" style = tfl_table OPTIONS(vspace="NO");
B.
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Or Try this one ?
proc template;
define style tfl_table;
style body /
leftmargin = 1in
rightmargin = 1in
topmargin = 0.5in
bottommargin = 0.5in;
style table /
frame = hsides
rules = groups
cellpadding = 3pt
cellspacing = 0pt
width = 100%;
style header /
/*This is the header line for the table.*/
fontfamily = 'Courier New'
fontsize = 9pt;
style data /
/*This is the data in the table.*/
fontfamily = 'Courier New'
fontsize = 9pt;
style SystemTitle /
fontfamily = 'Courier New'
color = red
fontsize = 10pt;
style systemfooter /
/*This affects the text in footnoteX statement.*/
textalign = left
fontfamily = 'Courier New'
fontsize = 9pt;
style NoteContent from Note /
/*change the font in the compute line*/
textalign = left
fontsize = 9pt
fontfamily = 'Courier New';
end;
run;
ods rtf file = "c:\temp\test-run.rtf" bodytitle style = tfl_table ;
title;
footnote;
proc report data = sashelp.class nowd;
column sex name age height weight;
define sex / group;
break after sex / page;
compute before _page_/
style={just=l bordertopwidth=2 bordertopcolor=white borderbottomwidth=2 borderbottomcolor=black};
line 'First Title with title1 statement';
line 'Second Title with title2 statement';
endcomp;
compute after sex/
style={just=l bordertopwidth=2 bordertopcolor=black borderbottomwidth=2 borderbottomcolor=white};
line 'footnote1 with footnote1 statement';
line 'footnote1 with footnote1 statement';
endcomp;
run;
ods rtf close;