BookmarkSubscribeRSS Feed
JohnChen_TW
Quartz | Level 8

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.

JohnChen_TW_0-1591779926273.png

 

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!

 

3 REPLIES 3
ballardw
Super User

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.

 

 

JohnChen_TW
Quartz | Level 8

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:

 

noa1a2a3
1EligibilityYes16 (100 %)
2Completed studyYes16 (100 %)
3ITT populationITT population16 (100 %)
4TD populationTD population16 (100 %)
5Immunogenicity populationImmunogenicity population16 (100 %)
6PK populationPK population16 (100 %)

 

Thanks!

JohnChen_TW
Quartz | Level 8
Hi ballardw,
Whether the programs I provided are sufficient to output the report that I need or not?
Thanks!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1120 views
  • 0 likes
  • 2 in conversation