BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BenConner
Pyrite | Level 9

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
I think you'll have to go to Tech Support. The only way I made it fit was by fudging the sizes. If you look a the whole row, however, you are telling PROC REPORT that the cell for the SQUARE variable is 16pt -- that is twice the size of the cell for your BOILERPLATE variable. But, maybe you're "over controlling" the height. What happens if you leave your original region height of 2.75in, but take the HEIGHT= out of the style override completely? Right now, you have the interaction of both heights, plus font sizes conflicting. I'd recommend taking HEIGHT= out of the STYLE(COLUMN) first.

cynthia

View solution in original post

8 REPLIES 8
Cynthia_sas
SAS Super FREQ
Hi:
Was there code? I only see a PDF with your table. But no code.

Did you ask Tech Support already?
cynthia
BenConner
Pyrite | Level 9

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;

Cynthia_sas
SAS Super FREQ
Hmmm. what's the difference between the &tan colors and the &red colors? Is there a disconnect in your code?
cynthia
Cynthia_sas
SAS Super FREQ

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

Cynthia_sas
SAS Super FREQ

Hi:

  I think it is your HEIGHT values that need to be adjusted. Through fiddling I eventually got to this.

cynthia

 

ods_layout_size.png

BenConner
Pyrite | Level 9

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

Cynthia_sas
SAS Super FREQ
Hi:
I think you'll have to go to Tech Support. The only way I made it fit was by fudging the sizes. If you look a the whole row, however, you are telling PROC REPORT that the cell for the SQUARE variable is 16pt -- that is twice the size of the cell for your BOILERPLATE variable. But, maybe you're "over controlling" the height. What happens if you leave your original region height of 2.75in, but take the HEIGHT= out of the style override completely? Right now, you have the interaction of both heights, plus font sizes conflicting. I'd recommend taking HEIGHT= out of the STYLE(COLUMN) first.

cynthia
BenConner
Pyrite | Level 9

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 8 replies
  • 1588 views
  • 1 like
  • 2 in conversation