Hi,
I'm trying to generate a 3 line entry in a Proc Report table going to a narrow table that is a bit constrained. It will fit. But something is providing too large a top and bottom margin in the cell for it to display all 3 lines.
Test program & sample pdf attached. What am I missing?
Thanks!!
--Ben
Hi Cynthia,
That's odd. Thought I had attached it. Obviously not. 🙂
I hadn't asked TS yet on this one. Was hoping it was something obvious I have missed.I seem to be having
I seem to be having problems attaching a file ending in .sas so I added it below.
--Ben
%let path=c:\temp\;
%let Tan = CXE59005;
%let Tan2 = CXFAA72E;
%let Tan3 = CXFCBE64;
%let Tan4 = CXFCD49A;
%let Tan5 = CXFDE6C3;
%let Blue = CX2B6BB0;
title;
* Generate fake data for testing;
data pcts;
input repid pct zip;
topzip+1;
if lag(repid)^=repid then topzip=1;
cards;
1 53 43058
1 17 43220
1 12 43235
1 7 43081
1 4 43214
;;;
ods escapechar='^';
options nodate nonumber nobyline orientation=landscape topmargin=.001in bottommargin=.001in leftmargin=.001in rightmargin=.001in;
ods html close ;
ods pdf file="&path.ziptablerpt.pdf" notoc;
ods layout absolute y=0in x=0in width=10.98in height=8.48in; * Define an absolute layout container with optional size parms;
ods region y=5in x=.5in width=1.5in height=2.75in style={background=cyan};
proc report data=pcts style(report)={cellpadding=0pt} style(column)={height=.32in} style(report)={borderwidth=0 cellpadding=1pct};
by repid;
column topzip square pct zip boilerplate;
define topzip /display order noprint;
define pct /display noprint;
define zip /display noprint;
define square /display computed "«" right
style(header)={font_size=16pt fontfamily='<ttf> Wingdings' vjust=m color=blue}
style(column)={font_size=16pt width=.3in vjust=m just=c fontfamily='<ttf> Monotype Sorts'};
define boilerplate /display computed 'You are located here' left
style(header)={font_size=7pt }
style(column)={font_size=7.5pt width=1.1in vjust=t background=grey};
compute square /character length=10;
square='n';
if topzip=1 then call define('square','style',"style={color=&red}");
if topzip=2 then call define('square','style',"style={color=&red2}");
if topzip=3 then call define('square','style',"style={color=&red3}");
if topzip=4 then call define('square','style',"style={color=&red4}");
if topzip=5 then call define('square','style',"style={color=&red5}");
endcomp;
compute boilerplate/character length=120;
boilerplate=cats(pct)||'% of your Regional^{newline 1}/Customers reside in ^S={color=blue}'||left(zip);
endcomp;
run;
ods layout end;
ods pdf close;
Hi,
I also see issues here -- not major, but conflicting cellpadding:
proc report data=pcts style(report)={cellpadding=0pt}
style(column)={height=.32in}
style(report)={borderwidth=0 cellpadding=1pct};
which one do you want. And then I see another issue with your style(column) -- have you multiplied out .32 * number of rows -- it might be enough space, but whether it is enough depends on the font size and cellpadding.
Just some additional thoughts. Not in a place where I am able to run code.
cynthia
Hi:
I think it is your HEIGHT values that need to be adjusted. Through fiddling I eventually got to this.
cynthia
Hi Cynthia,
Thanks for looking at it. Yes, I can solve the issue by making the cells higher but it is fitting into a fixed section of a report and that's all the room it has. Making it taller will run into other stuff.
See the space at the top of each cell in gray? How do I get rid of that? If that were eliminated it likely would all fit.
Much appreciated...
--Ben
Hi Cynthia,
That did it! I was even able to increase the font size a hair for readability and it still all came out.
Thank you so much!
--Ben
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 25. 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.