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!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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