I am creating a program that generates ods pdf and rtf outputs of proc report tables for different datasets that might be passed in. My system for table wrapping works well if each row has one or two lines of text in it-- I have pageno in my column statement of the proc report so there are only 13 rows on each page, allowing wide tables to wrap immediately following the first half of the table.
data work.&dataset;
set lib.&dataset;
pageno = ceil(_n_/13);
run;
But when the data needs to be wrapped into 3+ lines, it messes up the tables and how they are shown on the pages. Is there a way to fix the number of lines text can wrap to?
I would rather have wider columns and tables than have text wrap to three lines so that my observations are clearly listed together when the table wraps, but I need the column width to be dynamic so it is set automatically by SAS (ie I don't want to make the user set the column width to fix the way the table is presented).
Is there a way to do this?
Hi:
Without data and your PROC REPORT code, there's no way to test anything. In general, you need to control the column width when generating your PROC REPORT code, it doesn't happen dynamically. Just as you're controlling the page size with your pageno variable, you'll have to figure out a way to set the optimum column width that will work for most of your scenarios. This user group paper https://support.sas.com/resources/papers/proceedings14/SAS038-2014.pdf had a discussion of sizing your output, the discussion focused mainly on PDF vs HTML, but the PDF discussion does also relate to RTF and there were some examples of wrapping.
Cynthia
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!
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.
Ready to level-up your skills? Choose your own adventure.