如何将table下的线(______)更改为SAS中table(---)标题下的虚线?
How to change the line (______) under the table to dotted line under the heading in the table (---) in SAS?
我想把table标题下的线(_____________)改成table标题下的虚线(--------) =] 在 proc 报告步骤中。
我尝试使用 options formchar 仍然不适合我。
你能帮我么 ?如果需要数据,我可以通过聊天发送给您,因为数据是保密的
proc template;
%** Courier 9pt **;
define style Styles.ods_9pt;
parent=styles.rtf;
replace fonts/
'TitleFont2' = ("Courier New",9pt,Bold )
'TitleFont' = ("Courier New",9pt,Bold )
'FootnoteFont' = ("Courier New",9pt )
'StrongFont' = ("Courier New",9pt )
'EmphasisFont' = ("Courier New",9pt )
'FixedEmphasisFont' = ("Courier New",9pt )
'FixedStrongFont' = ("Courier New",9pt)
'FixedHeadingFont' = ("Courier New",9pt, Bold)
'BatchFixedFont' = ("Courier New",9pt,Bold )
'FixedFont' = ("Courier New",9pt )
'headingEmphasisFont' = ("Courier New",9pt,Bold )
'headingFont' = ("Courier New",9pt,Bold )
'docFont' = ("Courier New",9pt );
replace document from container /
asis = on
protectspecialchars=off;
replace SystemFooter from TitlesAndFooters /
asis = on
protectspecialchars = on
font= Fonts('FootnoteFont');
replace systemtitle from titlesandfooters/
asis = on
protectspecialchars=off;
replace body from document /
asis = on;
replace color_list
"Colors used in the default style" /
'link'= blue
'bgH'= white
'fg' = black
'bg' = white;
replace Table from output /
Background=_UNDEF_
cellpadding = 0pt
Rules=groups
Frame=void;
style Header from Header /
Background=_undef_;
style Rowheader from Rowheader /
Background=_undef_;
replace pageno from titlesandfooters/
Foreground=white;
end;
ods listing;
options papersize='LETTER' orientation=landscape topmargin = '3.61cm' bottommargin = '3.61cm'
leftmargin = '2.54cm' rightmargin = '2.54cm' nodate nonumber missing=.;
ods rtf file="/home/u000000/sasuser.v94/Listings/listing_Demo.rtf" style=styles.ods_9pt nogtitle nogfootnote;
ods escapechar = '~';
options formchar='|_---|+|---+=|-/\<>*'
options validvarname=any;
options pageno=1;
proc report data=newb nowd headline headskip split='*';
column num mypage TRT01A SITE BRTHDTC AGE SEX ETHNIC HEIGHTBL WEIGHTBL;
define num/ noprint;
*break after num/skip;
define mypage /order noprint;
break after mypage / page;
define TRT01A/'Treatment' order descending center style(column)={width=1in};
define SITE/'Site Id.*Unique Subject Id.' center style(column)={width=1in};
define BRTHDTC/'Date of*Birth' center style(column)={width=1in};
define AGE/'Age (YEARS)*[1]' center style(column)={width=1in};
define SEX/'Sex' center style(column)={width=1in};
define ETHNIC/'Ethnicity' center style(column)={width=1in};
define HEIGHTBL/'Height*(cm)' center style(column)={width=1in};
define WEIGHTBL/'Weight*(kg)'center style(column)={width=1in};
*compute after TRT01A;
*line '';
*endcomp;
title1 j=l height=10pt font="Courier New" "Protocol: XXX" ;
title3 j=l height=10pt font="Courier New" "Population :XXX" j=r 'Page ^{thispage} of ^{lastpage}';
title4;
title5 j=c height=10pt font="Courier New" "Listing";
title6 j=c height=10pt font="Courier New" "Listing of Demographic Characteristics";
title7;
footnote1 j = l height=10pt font="Courier New" "20NOV2020 10:42";
run;
ods rtf close;
ods listing;
@Reeza:你能帮我解决这个问题吗?
方式一
在报告中添加 line
。
ods rtf file='report.rtf' style=ods_9pt;
data class;
set sashelp.class;
page = 1;
run;
proc report data=class
style(header) = [BorderBottomStyle=hidden]
;
title;
where name < 'H';
columns page name age sex height weight;
define page / order noprint;
compute before page;
line '-----------------------------------------------------------';
endcomp;
run;
ods _all_ close;
方式二
您可以通过注入目标特定字符来操纵报告列 headers。
您还需要隐藏 header 底部边框。
示例:
更改样式定义,替换
style Header from Header / Background=_undef_;
至
style Header from Header / Background=_undef_ borderbottomstyle=hidden;
并在 Proc REPORT
中,更改列 headers 以包含要注入到 rtf table 单元格中的其他原始字符。
define TRT01A /
'Treatment*~{dest [RTF] ~{raw -------}}'
order descending center style(column)={width=1in};
技巧(列表)
REPORT
有一个 ODS LISTING
技巧:
- 如果分割线是两个相同的 formchar 字符,它们将在列宽内重复。
* ODS listing only;
Proc REPORT ...;
...
define TRT01A /
'Treatment*--`
order descending center;
...
我想把table标题下的线(_____________)改成table标题下的虚线(--------) =] 在 proc 报告步骤中。 我尝试使用 options formchar 仍然不适合我。 你能帮我么 ?如果需要数据,我可以通过聊天发送给您,因为数据是保密的
proc template;
%** Courier 9pt **;
define style Styles.ods_9pt;
parent=styles.rtf;
replace fonts/
'TitleFont2' = ("Courier New",9pt,Bold )
'TitleFont' = ("Courier New",9pt,Bold )
'FootnoteFont' = ("Courier New",9pt )
'StrongFont' = ("Courier New",9pt )
'EmphasisFont' = ("Courier New",9pt )
'FixedEmphasisFont' = ("Courier New",9pt )
'FixedStrongFont' = ("Courier New",9pt)
'FixedHeadingFont' = ("Courier New",9pt, Bold)
'BatchFixedFont' = ("Courier New",9pt,Bold )
'FixedFont' = ("Courier New",9pt )
'headingEmphasisFont' = ("Courier New",9pt,Bold )
'headingFont' = ("Courier New",9pt,Bold )
'docFont' = ("Courier New",9pt );
replace document from container /
asis = on
protectspecialchars=off;
replace SystemFooter from TitlesAndFooters /
asis = on
protectspecialchars = on
font= Fonts('FootnoteFont');
replace systemtitle from titlesandfooters/
asis = on
protectspecialchars=off;
replace body from document /
asis = on;
replace color_list
"Colors used in the default style" /
'link'= blue
'bgH'= white
'fg' = black
'bg' = white;
replace Table from output /
Background=_UNDEF_
cellpadding = 0pt
Rules=groups
Frame=void;
style Header from Header /
Background=_undef_;
style Rowheader from Rowheader /
Background=_undef_;
replace pageno from titlesandfooters/
Foreground=white;
end;
ods listing;
options papersize='LETTER' orientation=landscape topmargin = '3.61cm' bottommargin = '3.61cm'
leftmargin = '2.54cm' rightmargin = '2.54cm' nodate nonumber missing=.;
ods rtf file="/home/u000000/sasuser.v94/Listings/listing_Demo.rtf" style=styles.ods_9pt nogtitle nogfootnote;
ods escapechar = '~';
options formchar='|_---|+|---+=|-/\<>*'
options validvarname=any;
options pageno=1;
proc report data=newb nowd headline headskip split='*';
column num mypage TRT01A SITE BRTHDTC AGE SEX ETHNIC HEIGHTBL WEIGHTBL;
define num/ noprint;
*break after num/skip;
define mypage /order noprint;
break after mypage / page;
define TRT01A/'Treatment' order descending center style(column)={width=1in};
define SITE/'Site Id.*Unique Subject Id.' center style(column)={width=1in};
define BRTHDTC/'Date of*Birth' center style(column)={width=1in};
define AGE/'Age (YEARS)*[1]' center style(column)={width=1in};
define SEX/'Sex' center style(column)={width=1in};
define ETHNIC/'Ethnicity' center style(column)={width=1in};
define HEIGHTBL/'Height*(cm)' center style(column)={width=1in};
define WEIGHTBL/'Weight*(kg)'center style(column)={width=1in};
*compute after TRT01A;
*line '';
*endcomp;
title1 j=l height=10pt font="Courier New" "Protocol: XXX" ;
title3 j=l height=10pt font="Courier New" "Population :XXX" j=r 'Page ^{thispage} of ^{lastpage}';
title4;
title5 j=c height=10pt font="Courier New" "Listing";
title6 j=c height=10pt font="Courier New" "Listing of Demographic Characteristics";
title7;
footnote1 j = l height=10pt font="Courier New" "20NOV2020 10:42";
run;
ods rtf close;
ods listing;
@Reeza:你能帮我解决这个问题吗?
方式一
在报告中添加 line
。
ods rtf file='report.rtf' style=ods_9pt;
data class;
set sashelp.class;
page = 1;
run;
proc report data=class
style(header) = [BorderBottomStyle=hidden]
;
title;
where name < 'H';
columns page name age sex height weight;
define page / order noprint;
compute before page;
line '-----------------------------------------------------------';
endcomp;
run;
ods _all_ close;
方式二
您可以通过注入目标特定字符来操纵报告列 headers。 您还需要隐藏 header 底部边框。
示例:
更改样式定义,替换
style Header from Header / Background=_undef_;
至
style Header from Header / Background=_undef_ borderbottomstyle=hidden;
并在 Proc REPORT
中,更改列 headers 以包含要注入到 rtf table 单元格中的其他原始字符。
define TRT01A /
'Treatment*~{dest [RTF] ~{raw -------}}'
order descending center style(column)={width=1in};
技巧(列表)
REPORT
有一个 ODS LISTING
技巧:
- 如果分割线是两个相同的 formchar 字符,它们将在列宽内重复。
* ODS listing only;
Proc REPORT ...;
...
define TRT01A /
'Treatment*--`
order descending center;
...