The SAS Output Delivery System and reporting techniques

tagsets.ExcelXP question

SAS Employee
Posts: 11

tagsets.ExcelXP question

I am creating an excel worksheeet using ODS tagsets.ExcelXP.
I create an XML file and I can open it as expected in Excel. So far, so good.

When I try to add a title, for some reasons I am not able to see it in the Excel file. I find it in the XML, but not in Excel.

This is the code I submit:

proc template;
define style styles.XLStatistical;
parent = styles.Statistical;
style Header from Header /
style RowHeader from RowHeader /
style Data from Data /
run; quit;

%let _ODSDEST=tagsets.ExcelXP;
%let _ODSSTYLE=XLStatistical;

filename _webout "c:\temp\if.xml";
ods listing close;

* PROC REPORT is not setting column widths. So we must force them with
* default_column_width.
ods &_ODSDEST file=_webout style=&_ODSSTYLE options(default_column_width="7.5, 7.5, 5, 7.5, 7.5" );

TITLE1 font='Arial' height=4 "Title1";
TITLE2 font='Arial' height=4 "Title2";
TITLE3 font='Arial' height=4 "Title3";

proc report data=sashelp.class nowindows split='*';
column name sex age height weight;
define name / display 'Student*Name' left style={just=l};
define sex / display '*Gender' right style={just=r};
define age / display '*Age' center style={just=c};
define height / display 'Height*(inches)' center style={just=c};
define weight / display 'Weight*(pounds)' center style={just=c};
run; quit;
ods &_ODSDEST close;

Can you tell me how to make them visible in Excel?

Thanks a lot!
SAS Employee
Posts: 11

Re: tagsets.ExcelXP question

Posted in reply to Michela_sas
I just found myself the answer...:-)

I should use Option (embedded_titles='yes'), so the ods statement would be:

ods &_ODSDEST file=_webout style=&_ODSSTYLE options(default_column_width="7.5, 7.5, 5, 7.5, 7.5" embedded_titles='yes' );

Regards to all the forum members!
Ask a Question
Discussion stats
  • 1 reply
  • 1 in conversation