BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Dear Sir Madam

I have a problem.

I am using ODS Tagsets.excelxp to export into excel.(XLS file)

I am not able to see the footnote in the excel file.

Why?

 

 


data tbl1;
input ID Y w;
cards;
1 50 1000.5
2 30 2000.1
3 100 3000.2
4 5 4000
5 15 5000
;
run;

PROC SQL;
	create table tbl2 as
	select sum(	Y) as Total_Y   
	from tbl1
;
QUIT;

PROC SQL;
	create table tbl3 as
	select ID ,Y,w format=comma12., Y/Total_Y as PCT format=percent9.	   
	from tbl1,tbl2
;
QUIT;


ods path work.temptemp(update) sasuser.templat(update) 
sashelp.tmplmst(read);
ods path show; 
ods tagsets.excelxp file="/My path /example.xls" 
            style=htmlblue
          OPTIONS( absolute_column_width="17,20,7,9,9,9,11,13,11,11,11"
					autofit_heights='yes'
					embedded_titles='yes'
		          embedded_footnotes="yes"
					sheet_interval="NONE"  );

title1 'report1';
footnote1 'Data from 2018';
PROC REPORT data=tbl3 NOWD split='~';
columns _ALL_;
define _ALL_/display;
run;
Title;


ods tagsets.excelxp close;
ods _all_ close;   
2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Excel does not show footnotes as default (it really doesn't have a concept of footnotes).  You need to switch to print preview - its one of a small set of buttons to the lower right of the Excel window.  If you want output with titles/footnotes, you will be far better off using an output format which is designed for it like rtf/pdf.  Excel is rarely any use when "printed" like a report.

ballardw
Super User

A clarification: tagsets.excelxp does not create an XLS formatted file. It creates XML which is text that Excel can interpret. By using the xls extension on the file then likely your default application associated is Excel which will attempt to open the file.  

 

Microsoft is getting pickier with each version of Excel about warnings and/or refusing to open files whose structures do not match the extension.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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