BookmarkSubscribeRSS Feed
Michela_sas
SAS Employee
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 /
borderwidth=2;
style RowHeader from RowHeader /
borderwidth=2;
style Data from Data /
borderwidth=2;
end;
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!
1 REPLY 1
Michela_sas
SAS Employee
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!

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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
  • 1 reply
  • 1060 views
  • 0 likes
  • 1 in conversation