DATA Step, Macro, Functions and more

ods tagsets excelXP footnote problem

Accepted Solution Solved
Reply
Contributor
Posts: 21
Accepted Solution

ods tagsets excelXP footnote problem

Dear Sir or Madam,

 

I encountered a problem when I used excelXP to create multiple worksheets excel files. I need to have footnote for the first two pages, no footnote for the third page. But no footnote on the first page (I have footnote statement in the first sheet), footnote appeared on the second and third page,  even though I removed footnote statement on the third page and removed the options "embedded_footnote=yes". I am not sure why program worked this way.

Thanks a lot.

 

Xiumei

 


Accepted Solutions
Solution
‎08-01-2017 02:54 PM
Community Manager
Posts: 2,956

Re: ods tagsets excelXP footnote problem

[ Edited ]
Posted in reply to ChrisHemedinger

I saw you did attach a program, and it's as I thought: FOOTNOTE statements came after the PROCs, not before.  Here's a fixed version:

 

ods listing close;
ods excel file="/home/xiumei/SAS_example/firstpage.xlsx" style=printer;
ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="first page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 1";
footnote2 justify=left "the second footnote on page 1";
proc report data=sashelp.adsmsg nowd split='%';
run;

ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="second page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 2";
footnote2 justify=left "the second footnote  on page2 ";
proc report data=sashelp.air nowd split='%';
run;

ods excel options(embedded_titles="yes" sheet_name="third page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote; /* clear footnote */
proc report data=sashelp.bei nowd split='%';
run;
ods excel close;

View solution in original post


All Replies
Super User
Posts: 19,873

Re: ods tagsets excelXP footnote problem

1. What version of tagsets are you using? Check log after runnint tagsets to see the version number.

2. Can you post some code so we can replicate your issue, using data from SASHELP so we can run it as well.

Contributor
Posts: 21

Re: ods tagsets excelXP footnote problem

Hello,

 

Thanks for your reply. the version is "This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.127, 09/26/2011)"

Please see the attached program.

Thanks.

 

Xiumei

 

 

Attachment
Super User
Posts: 19,873

Re: ods tagsets excelXP footnote problem

The latest version is 1.131

You can download it here and then give it a try again.

https://support.sas.com/rnd/base/ods/odsmarkup/index.html

 

If you're on SAS 9.4 then you can also consider ODS EXCEL.

Community Manager
Posts: 2,956

Re: ods tagsets excelXP footnote problem

+1 for ODS Excel.  It's superior to ODS tagsets.excelXP in most respects, especially in that it creates a true native XLSX file.  Most excelXP options are supported, so it usually doesn't need a ton of work to modify your code.

 

Documentation here: ODS EXCEL Statement.

Contributor
Posts: 21

Re: ods tagsets excelXP footnote problem

Posted in reply to ChrisHemedinger

Thanks for your reply. I do use ods excel for my programs, but this didn't resolve the footnote problem. Instead of using ExcelXP, I used ods excel in my program, the probem still exists. thanks.

 

xiumei

 

Contributor
Posts: 21

Re: ods tagsets excelXP footnote problem

Hello,

 

That means the footnote problem is not resolved in ods tagsets ExcelXP version 1.127. I don't know how to install the version 1.13.

I tried to use ods excel instead of ods tagsets ExcelXP, but problem is the same. thanks.

 

xiumei

 

Community Manager
Posts: 2,956

Re: ods tagsets excelXP footnote problem

[ Edited ]

Be sure to check the positioning of your FOOTNOTE statement.  As a global statement it gets processed first, and then the footnote is rendered as part of the next procedure output that you run.

 

In short, make sure FOOTNOTE appears before the PROC that generates the output you want, not after.

Solution
‎08-01-2017 02:54 PM
Community Manager
Posts: 2,956

Re: ods tagsets excelXP footnote problem

[ Edited ]
Posted in reply to ChrisHemedinger

I saw you did attach a program, and it's as I thought: FOOTNOTE statements came after the PROCs, not before.  Here's a fixed version:

 

ods listing close;
ods excel file="/home/xiumei/SAS_example/firstpage.xlsx" style=printer;
ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="first page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 1";
footnote2 justify=left "the second footnote on page 1";
proc report data=sashelp.adsmsg nowd split='%';
run;

ods excel options(embedded_titles="yes" embedded_footnotes="yes" sheet_name="second page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote1 justify=left "the first footnote on page 2";
footnote2 justify=left "the second footnote  on page2 ";
proc report data=sashelp.air nowd split='%';
run;

ods excel options(embedded_titles="yes" sheet_name="third page");
title1 "Try footnote";
title2 "as of &sysdate.";
footnote; /* clear footnote */
proc report data=sashelp.bei nowd split='%';
run;
ods excel close;
Contributor
Posts: 21

Re: ods tagsets excelXP footnote problem

Posted in reply to ChrisHemedinger

Thanks for your answer. Yes, after I moved the footnote before the proc procedures, the footnote display correctly. Thanks again.

 

Xiumei

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 201 views
  • 3 likes
  • 3 in conversation