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

Hi all,

I am trying to do something that should be simple but despite googling I can not find the answer. I have code that produces a contact history per client and all I want to do is increase the space between the tables. I know I can use a compute after page but then it puts the bottom border after the space and this looks horrible.

 

I've shown below where I want the space - can anyone please help?sas_issue.png

 

 

 

 

 

 

 

 

 

 

 

 

 

I dont want to put the space above the table if possible as this will also look horrible (this is part of a wider report).

 

My code is:

 

options orientation = landscape 
			papersize = A4 
			nodate 
			nobyline
			nonumber 
			missing = ''
			nocenter 
			topmargin 		= "0cm"
			bottommargin 	= "0cm"
	        leftmargin 		= "1.5cm" 
	        rightmargin 	= "1cm" ;

	ods graphics  no ;
	goptions dev=png;

	ods noresults escapechar = '~' ;

	ods pdf file = "/Demog/test.pdf"  
					compress = 9
					uniform
					pdftoc = 1
					startpage = no
					style = Journal ;


	ods proclabel = "Contact History" ;

	title1 c='#0B8080' h=14pt f='Arial' bold 'Contact History'; 

	proc report data = contact_history nowd
			style(header)=[foreground = #0B8080 
					   	   font_size=12pt 
						   font_face = arial
						   fontstyle = roman
						   just = l
						   font_weight = light]
			style(column)=[font_size=10pt 
						   font_face = arial
						   just = left] 
			style(lines)=Header{font=(Arial, 12pt) 
						 bordertopcolor= white
						 foreground = #0B8080 just = l};

			by swn client ;

			column 	swn client contact cd_type_wid startdt profile_end ;

			define swn / noprint order order=internal ;
			define client / noprint ;
			define contact / 'Contact' style = {cellwidth = 8cm} ;
			define cd_type_wid / 'Type' style = {cellwidth = 3cm} ;
			define startdt / 'Start Date' format = ddmmyy10. style = {cellwidth = 3cm} ;
			define profile_end / 'End Date' style = {cellwidth = 3cm} ;

		   compute contact;
		      count+1;
		      if mod(count,2) then do;
		         call define(_row_, "style", "style=[background=#DBECEC]");
		      end;
		   endcomp;

			compute before _page_;
				pgstr = catx(' ',client,cats('(',swn,')'));
				line pgstr $varying100. ;
			endcomp;

			break after swn / page; 

		run ;	

	ods pdf close ;

 

Any help, really appreciated.

regards

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

In the compute blocks you can specify a style, this allows you to set the cell height.

 

See this code example, the yellow background is just to show the area that is taken by the compute after _page_ style definition.

You do need the LINE statement otherwise nothing is produced.

 

proc sort data=sashelp.class out=class_s;
  by age;
run;

ods pdf file="c:\temp\sample.pdf" startpage=no style=journal;

proc report data=class_s
  style(report) = { width=100pct }
;
  by age;

  column age name sex height;

  define age / display noprint;
  define name / display;
  define sex / display;
  define height / analysis sum;

  compute after _page_ / style={height=2cm background=yellow just=l BORDERBOTTOMcolor=white};
/*    line "after page for " age z4.;*/
    line " ";
  endcomp;
run;

ods pdf close;

View solution in original post

4 REPLIES 4
Reeza
Super User
I'm going to guess you can do that with extra 'blank' LINE statements? If you get a line that you don't want, you can change it with the STYLE options?
Cynthia_sas
SAS Super FREQ

Hi:

  Is this closer to the spacing you want:

pdf_extra_space.png

Experiment with adding blanks in the COMPUTE BEFORE _PAGE_. After I made some fake data from SASHELP.CLASS, that's what gave me the wider gap between BY groups.

 

Cynthia

BrunoMueller
SAS Super FREQ

In the compute blocks you can specify a style, this allows you to set the cell height.

 

See this code example, the yellow background is just to show the area that is taken by the compute after _page_ style definition.

You do need the LINE statement otherwise nothing is produced.

 

proc sort data=sashelp.class out=class_s;
  by age;
run;

ods pdf file="c:\temp\sample.pdf" startpage=no style=journal;

proc report data=class_s
  style(report) = { width=100pct }
;
  by age;

  column age name sex height;

  define age / display noprint;
  define name / display;
  define sex / display;
  define height / analysis sum;

  compute after _page_ / style={height=2cm background=yellow just=l BORDERBOTTOMcolor=white};
/*    line "after page for " age z4.;*/
    line " ";
  endcomp;
run;

ods pdf close;
SteveNZ
Obsidian | Level 7

Thanks all for replying, really appreciated. Bruno your solution is perfect thanks. I was trying all sorts in the compute after page style but didn't have the line in. 

 

regards

Steve

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2959 views
  • 0 likes
  • 4 in conversation