Hi,
I'm trying to get a handle on gridded layouts and how they can be used in conjunction with absolute layouts.
Can a gridded layout be nested within an absolute layout? If so, then consider the following sample code:
1590 %let path=c:\temp\;
1591
1592 options orientation=landscape;
1593 ods escapechar='^';
1594
1595 ods PDF file="&path.temp.pdf" notoc dpi=150;
NOTE: Writing ODS PDF output to DISK destination "c:\temp\temp.pdf", printer "PDF".
1596
1597 ods layout absolute y=.25in x=.25in width=10.5in height=8in;
1598
1599 ods layout gridded advance=bygroup column_gutter=0in
1600 x=0in y=1.8in
1601 columns=2 column_widths=(5in 5in)
1602 rows=3 row_heights=(2in 2in 2in);
WARNING: LAYOUT placement exceeds available space for PDF destination. Setting Y=0in.
1603
1604 ods region;
1605 ods layout end;
1606
1607 ods layout end;
1608 ods pdf close;
NOTE: ODS PDF printed 1 page to c:\temp\temp.pdf.
In landscape mode, the vertical distance inside the absolute layout is 8 inches. The grid started at 1.8 inches and had 6 more inches for the 3 rows, for 7.8 inches. So I don't understand why Y was set to 0. ?
Thanks!
--Ben
Ok, apparently embedding one layout inside another isn't a real good idea. 🙂 Next question that comes up is with a layout statement like:
ods layout gridded advance=bygroup order_type=row_major column_gutter=0in
x=0in y=1.027in width=10in height=6.25in
columns=2 column_widths=(5in 5in)
rows=3 row_heights=(2in 2in 2in);
I would think this would fit 3 rows and 2 columns on a page; what I'm seeing is 1 row printing, then advancing to the next page. ?
--Ben
Found the issue. There is a row_gutter= value as well that I didn't set. Making that = to 0in did the trick.
--Ben
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.
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.