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

I am trying to remove the extra row between a title and table, and footnote and table when using PROC REPORT and ODS EXCEL.

When the excel file is produced there is always a row between the title and the table, and the table and footnote. I would like to remove both of these empty rows. I have provided some sample code, and a screenshot of the resulting report. The yellow rows are the ones I would like to remove. Thanks in advance!  

 

ods excel file ="&reportpath\Daily BLAH, &MC1DS_WORDDATE..xlsx" options (

	sheet_interval = 'none'
	embedded_titles = 'on' 
	tab_color='purple' start_at='1,1'
	frozen_headers='no' 
	ROW_HEIGHTS ='14,00,0,35,0,14,0'

	
);

ods escapechar='^';

title j=c bold "Approved BLAH BLAH Requests on &MC1DS_WORDDATE.";
proc report data=sbc4 (where = (request_date=&MC1DS.)) completerows;
columns var2 approved;
define var2/ group  "Requests" style(column)={just=l}
	exclusive preloadfmt format = approved.;
define approved / analysis n "Total"  ;
run;

title j=c bold "This Count by That";
proc report data=sbc4 (where = (request_date=&MC1DS.))  ;
columns var1 var2;
define var1/ group 'Var1' ;
compute var1;
IF _break_ in ('_RBREAK_') THEN do;
	var1= 'Grand Total';
	end;
endcomp;
define var2/ analysis n 'Total';
RBREAK after / summarize ;
footnote1 "This is footnote1.";
run; ods listing; ods
excel close;
Annotation 2019-10-10 092628.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Try this at the end of your proc report code instead of the footnote:

 

   compute after ;
       text='Footnote text goes here.';
       line text $50.;
   endcomp;
run;

View solution in original post

5 REPLIES 5
data_null__
Jade | Level 19

Post and example with data that we can run.  

 


@RussellShekha wrote:

I am trying to remove the extra row between a title and table, and footnote and table when using PROC REPORT and ODS EXCEL.

When the excel file is produced there is always a row between the title and the table, and the table and footnote. I would like to remove both of these empty rows. I have provided some sample code, and a screenshot of the resulting report. The yellow rows are the ones I would like to remove. Thanks in advance!  

 

ods excel file ="&reportpath\Daily BLAH, &MC1DS_WORDDATE..xlsx" options (

	sheet_interval = 'none'
	embedded_titles = 'on' 
	tab_color='purple' start_at='1,1'
	frozen_headers='no' 
	ROW_HEIGHTS ='14,00,0,35,0,14,0'

	
);

ods escapechar='^';

title j=c bold "Approved BLAH BLAH Requests on &MC1DS_WORDDATE.";
proc report data=sbc4 (where = (request_date=&MC1DS.)) completerows;
columns var2 approved;
define var2/ group  "Requests" style(column)={just=l}
	exclusive preloadfmt format = approved.;
define approved / analysis n "Total"  ;
run;

title j=c bold "This Count by That";
proc report data=sbc4 (where = (request_date=&MC1DS.))  ;
columns var1 var2;
define var1/ group 'Var1' ;
compute var1;
IF _break_ in ('_RBREAK_') THEN do;
	var1= 'Grand Total';
	end;
endcomp;
define var2/ analysis n 'Total';
RBREAK after / summarize ;
footnote1 "This is footnote1.";
run; ods listing; ods
excel close;
Annotation 2019-10-10 092628.png

 


 

ballardw
Super User

Try this at the end of your proc report code instead of the footnote:

 

   compute after ;
       text='Footnote text goes here.';
       line text $50.;
   endcomp;
run;
RussellShekha
Fluorite | Level 6

Thank you @ballardw that did the trick with a little editing. I needed to be able to add font formatting to the lines, so this is what I went with.

 

To avoid an empty row between the title and the table:

 

compute before _page_

/ style=[font_weight=bold font_size=16pt just=center];

line "This is a title" ;

endcomp;

 

Between table and footnote:

 

compute after _page_

/ style=[font_weight=bold font_size=9pt just=center];

line "This is a footnote.";

endcomp;

Cynthia_sas
SAS Super FREQ

Hi:
The only thing I can think of is using hidden_rows suboption or the row_heights suboption. You can look in the documentation for examples of the full syntax. Here are examples using SASHELP.CLASS. think the row_heights suboption is probably the most flexible of the 2 methods since it doesn't depend on knowing which rows to "hide".

 
hidden_rows output:

hidden_rows.png

 

row_heights output:

change_heights.png

 

Hope this helps,
Cynthia

RussellShekha
Fluorite | Level 6

@Cynthia_sas I will give this a try as well. This might be a more direct way that allows you to keep using title and footnote in the proc. Thank you!

SAS Innovate 2025: Register Now

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!

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
  • 5 replies
  • 4437 views
  • 4 likes
  • 4 in conversation