The SAS Output Delivery System and reporting techniques

Proc Print - adjust cellheight of blankline

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

Proc Print - adjust cellheight of blankline

Any way i can adjust the height of the Blankline in Proc Print? Here's an example of what I tried (obviously, doesn't work):

 


data x;
do a = 1 to 6;
b = a + 1;
output;
end; run;
ods powerpoint file = 'C:\test.pptx';
proc print data = x noobs label blankline=(count=2 style={cellheight=0.1in});
var a /style=[cellwidth=2in just=c TEXTALIGN=left VERTICALALIGN= MIDDLE fontsize=11pt];
var b /style=[cellwidth=2in just=c TEXTALIGN=left VERTICALALIGN= MIDDLE fontsize=11pt];
run;
ods powerpoint close;

 

 

Thanks,

Dave


Accepted Solutions
Highlighted
Solution
3 weeks ago
SAS Super FREQ
Posts: 8,818

Re: Proc Print - adjust cellheight of blankline

Hi, Well, I found that I can change the height of the blank line in PROC PRINT for HTML but not in PPTX. However, with PROC REPORT, I can generate output that changes the height in both destinations.

inserting_small_blank.png

 

Here's the code I used (changed your style overrides .. just and textalign are the same option):


** need BLNKVAR to insert blank line in PROC REPORT;
** want to group observations by "twos" so a blank can be inserted;
** every 2 rows;
data x;
do a = 1 to 6;
b = a + 1;
blnkvar =  round(a,2);
output;
end; 
run;
  
title;
ods html file='c:\temp\test_blank_height.html';
ods powerpoint file = 'C:\temp\test_blank_height.pptx';
proc print data = x noobs label blankline=(count=2 style={height=3pt font_size=1pt})
     style(header)=[cellwidth=2in just=c VERTICALALIGN= MIDDLE fontsize=11pt]
     style(data)=[cellwidth=2in just=c   VERTICALALIGN= MIDDLE fontsize=11pt];
title 'proc print -- height works in HTML, not in PPTX';
var a b;
run;

proc report data=x
  style(header)=[cellwidth=2in just=c  VERTICALALIGN= MIDDLE fontsize=11pt] 
  style(column)=[cellwidth=2in just=c  VERTICALALIGN= MIDDLE fontsize=11pt];
  title 'proc report -- height works in HTML and PPTX';
  column blnkvar a b;
  define blnkvar / order noprint;
  define a / display;
  define b / display;
  compute after blnkvar/style={height=3pt font_size=1pt};
	line ' ';
  endcomp;
run;

ods _all_ close;
title;

 

Hope this helps,

cynthia

View solution in original post


All Replies
Frequent Contributor
Posts: 83

Re: Proc Print - adjust cellheight of blankline

Instead of cellheight=0.1in, I tried fontsize=5pt with your example.  That works in HTML and RTF, but not the PowerPoint destination. 

Highlighted
Solution
3 weeks ago
SAS Super FREQ
Posts: 8,818

Re: Proc Print - adjust cellheight of blankline

Hi, Well, I found that I can change the height of the blank line in PROC PRINT for HTML but not in PPTX. However, with PROC REPORT, I can generate output that changes the height in both destinations.

inserting_small_blank.png

 

Here's the code I used (changed your style overrides .. just and textalign are the same option):


** need BLNKVAR to insert blank line in PROC REPORT;
** want to group observations by "twos" so a blank can be inserted;
** every 2 rows;
data x;
do a = 1 to 6;
b = a + 1;
blnkvar =  round(a,2);
output;
end; 
run;
  
title;
ods html file='c:\temp\test_blank_height.html';
ods powerpoint file = 'C:\temp\test_blank_height.pptx';
proc print data = x noobs label blankline=(count=2 style={height=3pt font_size=1pt})
     style(header)=[cellwidth=2in just=c VERTICALALIGN= MIDDLE fontsize=11pt]
     style(data)=[cellwidth=2in just=c   VERTICALALIGN= MIDDLE fontsize=11pt];
title 'proc print -- height works in HTML, not in PPTX';
var a b;
run;

proc report data=x
  style(header)=[cellwidth=2in just=c  VERTICALALIGN= MIDDLE fontsize=11pt] 
  style(column)=[cellwidth=2in just=c  VERTICALALIGN= MIDDLE fontsize=11pt];
  title 'proc report -- height works in HTML and PPTX';
  column blnkvar a b;
  define blnkvar / order noprint;
  define a / display;
  define b / display;
  compute after blnkvar/style={height=3pt font_size=1pt};
	line ' ';
  endcomp;
run;

ods _all_ close;
title;

 

Hope this helps,

cynthia

Contributor
Posts: 27

Re: Proc Print - adjust cellheight of blankline

thanks! - all three pieces of info were helpful: 1) use pt instead of in; 2) rtf works, but not ppt (found that pdf works also); 3) a great template to use with  Proc Report.

Dave

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 252 views
  • 3 likes
  • 3 in conversation