BookmarkSubscribeRSS Feed
morglum
Quartz | Level 8

Now that took me a while to figure out.   The superscripts in my reports where supersmall, and I couldnt figure out why.  Turns out superscripts are DPI-dependent.  Try the script below using dpi=100 and dpi=300 to see what I mean.

 

Any way to prevent this behaviour?

thanks!

 

 

 


ods pdf file="c:\temp\report1.pdf" dpi=300;
OPTIONS NODATE NONUMBER;
ods escapechar = '^'; 
title1  
 	j=c "Title" ;
title2 
	j=c "Subtitle";
*note : le truc pour les spanned header de colonnes vient de Beyond the Basics: Advanced PROC REPORT Tips and Tricks ";

footnote1 j=l "Footnote1";
footnote2 j=l "Footnote2";


proc sort data= sashelp.class out=temp;; by sex height weight;
run;

data temp;
set temp;
by sex;
if first.sex then sex2= sex;
else sex2="";
obs=_n_;
weight_cat= floor(weight/10)*10;
_empty=' ';
run;

proc report data=temp ls=120 ps=40 nowd 
	split="*"
	style(report)=
		[]
	style(header)=
		[just=r]
	style(column)=
		[just=r];

column 
	obs
	sex2
	name
	_empty
	("^S={just=c borderbottomwidth=2 borderbottomcolor=&lightgrey.} Metrics^{super 1}" height weight )
	row_color
;
define obs /display noprint;
define sex2/display  "Sex" style(header)=[just=l borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=l];
define name /display "Name" style(header)=[just=l  borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=l];
define _empty/' ' style(column)={cellwidth=1%}  style(header)=[just=c vjust=top borderbottomcolor=lightgrey]; 
define height/display  "Height" format =5.1 style(header)=[just=r borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=r];
define weight /display "Weight^{super 2}" format =5.0 style(header)=[just=r borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=r ] format=16.;
define row_color  /computed noprint;
  
compute row_color;
		if mod(obs,2)=1 then call define (_row_,"style","style=[background=&verylightgrey.]");
		if weight<=100 then call define ("weight","style","style=[font_weight=bold  background=GREEN ");
		if weight>=100 then call define ("weight","style","style=[font_weight=bold  background=red ");
endcomp;

run;
quit;
ods pdf close;

 


300dpi.png100dpi.png
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
HI:
I think this is more of a question for Tech Support.
cynthia
Ksharp
Super User

Good for me . Maybe you need try other STYLE or unicode.

 

x.png

 

 

ods pdf file="/folders/myfolders/report1.pdf" dpi=300 style=sasweb;
OPTIONS NODATE NONUMBER;
ods escapechar = '^';
title1
j=c "Title" ;
title2
j=c "Subtitle";
*note : le truc pour les spanned header de colonnes vient de Beyond the Basics: Advanced PROC REPORT Tips and Tricks ";

footnote1 j=l "Footnote1";
footnote2 j=l "Footnote2";


proc sort data= sashelp.class out=temp; by sex height weight;
run;

data temp;
set temp;
by sex;
if first.sex then sex2= sex;
else sex2="";
obs=_n_;
weight_cat= floor(weight/10)*10;
_empty=' ';
run;

proc report data=temp ls=120 ps=40 nowd
split="*"
style(report)=
[]
style(header)=
[just=r]
style(column)=
[just=r];

column
obs
sex2
name
_empty
("^S={just=c borderbottomwidth=2.} Metrics^S={fontsize=80px}^{super 1} ^{unicode 00b2}" height weight )
row_color
;
define obs /display noprint;
define sex2/display "Sex" style(header)=[just=l borderbottomwidth=2 borderbottomcolor=lightgrey] style(column)=[just=l];
define name /display "Name" style(header)=[just=l borderbottomwidth=2 borderbottomcolor=lightgrey] style(column)=[just=l];
define _empty/' ' style(column)={cellwidth=1%} style(header)=[just=c vjust=top borderbottomcolor=lightgrey];
define height/display "Height" format =5.1 style(header)=[just=r borderbottomwidth=2 borderbottomcolor=lightgrey] style(column)=[just=r];
define weight /display "Weight^{super 2}" format =5.0 style(header)=[just=r borderbottomwidth=2 borderbottomcolor=lightgrey] style(column)=[just=r ] format=16.;
define row_color /computed noprint;

compute row_color;
if mod(obs,2)=1 then call define (_row_,"style","style=[background=lightgrey]");
if weight<=100 then call define ("weight","style","style=[font_weight=bold background=GREEN ");
if weight>=100 then call define ("weight","style","style=[font_weight=bold background=red ");
endcomp;

run;
quit;
ods pdf close;

morglum
Quartz | Level 8

Thanks Xia!

I've tried to code and it looked fine at first.  Then I changed the dpi down to 100dpi and the superscript was back to super large.  I dont meant to use such a low dpi, but the issue is weird.    Meanwhile, here's the reply I got from tech support:

 

 

------email 1 ------------------------------------------

This is in regards to tracking number 7611714840 where you described the following problem:

 

********

 The size of superscripts using escapechars is DPI-dependent in ODS PDF

********

 

I am finding a defect on this issue, and have updated that defect with your report of the problem.  The current strategy to work around the problem is to use a non-SAS provided font. In the attached code you will see the use of Times here:

 

   style(header)=[just=r font_face="Times"]

 

Please let me know if this information helps you get the desired results.

---email2--------------------------------------------

I am seeing the problem persist when I use Tahoma, which along with Thorndale AMT (the default font for headers in the PRINTER style used by ODS PDF) is a true type font. I believe Times is a Type 1 / postscript font, so the distinction for the problem may be: When truetype fonts are used, the SUPER function is influenced by the DPI= setting on the ODS PDF statement.

 

I am sorry to not have better news, but hope the header switch to Times helps you get the desired results.

 

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1447 views
  • 0 likes
  • 3 in conversation