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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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