Hi everyone,
I'm trying to create a report in PDF with Times New Roman, 9pt by PROC REPORT. But I found sometimes the string of characters is presented with no space, see below table.
Herewith my Style program:
proc template;
define style Styles.mystyle;
parent = styles.Printer;
replace fonts /
'TitleFont2' = ("Times Roman",9pt,Bold Italic)
'TitleFont' = ("Times Roman",9pt,Bold Italic)
'StrongFont' = ("Times Roman",9pt,Bold)
'EmphasisFont' = ("Times Roman",9pt, Bold)
'FixedEmphasisFont' = ("Times Roman",9pt,Bold)
'FixedStrongFont' = ("Times Roman",9pt,Bold)
'FixedHeadingFont' = ("Times Roman",9pt,Bold)
'BatchFixedFont' = ("Times Roman",9pt,Bold)
'FixedFont' = ("Times Roman",9pt,Bold)
'headingEmphasisFont' = ("Times Roman",9pt,Bold )
'headingFont' = ("Times Roman",9pt,Bold)
'docFont' = ("Times Roman",9pt)
'footFont' = ("Times Roman",9pt,Bold Italic);
replace GraphFonts /
'GraphDataFont' = ("Times Roman",9pt)
'GraphValueFont' = ("Times Roman",9pt)
'GraphLabelFont' = ("Times Roman",9pt,Bold)
'GraphFootnoteFont' = ("Times Roman",9pt,Bold)
'GraphTitleFont' = ("Times Roman",9pt,Bold);
replace color_list /
'link' = blue
'bgH' = Lightgrey
'fg' = black
'bg' = _undef_;
replace Table from Output /
background = _undef_
frame = hsides
rules = groups
vjust = M
cellpadding = 1pt
cellspacing = 0.25pt
borderwidth = 0.25pt;
replace SystemFooter from TitlesAndFooters /
just = L
font = fonts('docFont');
end;
run;
I know I can output the report with the font "Courier New" which has the equal width in every character.
But a problem is, the data presented with font "Courier New" would be less than with the font "Times New Roman" in the limited length of page. That said, it will take more pages to provide the same data than Times New Roman.
Any suggestions to avoid this problem if I have to output the report with "Times New Roman, 9pt"?
Thanks!
The code that generates the output is where?
And example data that will demonstrate the issue?
You have not provided enough information to show this may not be a data content issue.
Here is my output code:
proc format ;
picture p(round) 0-100='0009.99%)'(prefix=' (');
value $NoDot .=' ';
run;
options nodate nonumber papersize=A4 topmargin="0.25in" leftmargin="0.25in" bottommargin="0.25in" rightmargin="0.25in" missing=' ';
ods escapechar='~'; footnote3 j=l;footnote4 j=l;
ods proclabel="Sample";
ods document name=WORK.CONTENTS(write);
PROC REPORT DATA=work.sample nofs NOWD SPLIT= '|'
CONTENTS="Analysis Population";
COLUMNS blank no a1 a2 a3;
DEFINE no /order noprint;
DEFINE a1 /group noprint;
DEFINE a2 /display left style=[cellwidth=40mm]'Variable';
DEFINE a3 /display center style=[cellwidth=30mm]'All Subjects';
DEFINE blank /computed ' ' format=$NoDot. style=[cellwidth=10mm];
COMPUTE blank; blank=.; endcomp;
COMPUTE BEFORE a1 /style={just=left}; line " "; line a1 $100.; endcomp;
BREAK AFTER a1 /skip;
RUN;
QUIT;
ods document close;
%multisheet;
ods rtf file="C:\Users\john.chen\Desktop\Table.rtf" style=Styles.mystyle ;
ods printer pdf file="C:\Users\john.chen\Desktop\Table.pdf" style=Styles.mystyle /* notoc*/ ; replay; run;
ods printer pdf close;
ods rtf close;
My data is:
no | a1 | a2 | a3 |
1 | Eligibility | Yes | 16 (100 %) |
2 | Completed study | Yes | 16 (100 %) |
3 | ITT population | ITT population | 16 (100 %) |
4 | TD population | TD population | 16 (100 %) |
5 | Immunogenicity population | Immunogenicity population | 16 (100 %) |
6 | PK population | PK population | 16 (100 %) |
Thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: