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

Hi,

I am trying to use proc report to generate a report with many columns, it is not possible to fit all the columns in one page, is it possible to make the rest of the columns on the following page?

here is the code I am using, what I got is several columns on the first pages, after all the content of these columns showed, then continue to other columns

proc report data=final headline headskip spacing=2 split='|' missing formchar(2)='_' nowd style(report)={width=100%};    
	column (_fstcol subjid diagdtc PCANSTG tnm PTUMTYP PTUMLOC METFL metloc metadtc _tp53 _mdm2 _cdk _atmatr _fgfr _MICROS _IHC _tmb _STK11);
	define _fstcol /"Phase/|Dose Level|or Cohort[a]" display left &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.7in asis=on just=left];
	define subjid /"Pt. No." display center  &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.3in asis=on just=left];
	define diagdtc /"Date of|Initial|Diagnosis" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.6in asis=on just=left];
	define PCANSTG /"Stage|at|Diagnosis" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.4in asis=on just=left];
	define tnm /"T/N/M|Classification|/TNM Staging" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define PTUMTYP /"Primary|Tumor|Type" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define PTUMLOC /"Primary|Tumor|Site" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define METFL /"Any|Metastases" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define metloc /"Site of|Metastatic|Disease" display center &line. style(header)=[just=left asis=on] flow style(column)=[cellwidth=0.5in asis=on just=left];
	define metadtc /"Date|Metastases|Identified" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _tp53 /"TP53/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _mdm2 /"MDM2/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _cdk /"CDK4/6/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _atmatr /"ATM/ATR/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _fgfr /"FGFR/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _MICROS /"Microsatelites Status/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _IHC /"IHC Store|Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _tmb /"TMB/Result/Method/NGS panel" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];
	define _STK11 /"STK-11/Method" display center &line. style(header)=[just=left asis=on] style(column)=[cellwidth=0.5in asis=on just=left];



	compute before _page_ ;
		line "@R/RTF'\fs0\brdrb\brdrs\brdrw30\cf1 ";
	endcomp;

run;

Many thanks for your help in advance

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

By the raw codes in your compute before block I have to assume that you are writing to ODS RTF, correct?

 

Are you restricted to making a file that fits on a specific type of paper? If this is only to be an online document you can change the paper size before creating the output so rows fit on one line of output.

If you must fit this to a specific paper size you might consider including at least one group variable so that broken column order has some chance of being read correctly. Otherwise it is going to be extremely difficult to read and align multiple pages to read correctly.

View solution in original post

3 REPLIES 3
ballardw
Super User

By the raw codes in your compute before block I have to assume that you are writing to ODS RTF, correct?

 

Are you restricted to making a file that fits on a specific type of paper? If this is only to be an online document you can change the paper size before creating the output so rows fit on one line of output.

If you must fit this to a specific paper size you might consider including at least one group variable so that broken column order has some chance of being read correctly. Otherwise it is going to be extremely difficult to read and align multiple pages to read correctly.

andreas_lds
Jade | Level 19

If all columns won't find on a single page, even when page format is landscape, then usefulness and readability of the table need to be discussed. Unfortunately the argument "it has always been like this" almost always beats common sense.

 

I haven't found any option to trigger a page break after some variables have been written to the output destination.

Ksharp
Super User
1) Change your
cellwidth=0.5in
into
cellwidth=1%

2)using options:
options papersize=(200cm 200cm) ;

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 3 replies
  • 416 views
  • 0 likes
  • 4 in conversation