BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I want to control font size in all tables that are exported in  ODS tagsets.ExcelXP.

I want to have tables in excel with excel size 8.

What is the way to control data font size in excel exported output from  ODS tagsets.ExcelXP?

 

Thaks

 

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:
The method you use will depend on the procedure you have inside your ODS TAGSETS.EXCELXP "sandwich" -- for PRINT, REPORT or TABULATE -- you can change the font of the output with a simple style override.

Cynthia

 

Here's an example:

ods tagsets.excelxp file='c:\temp\change_font.xml' style=htmlblue
    options(sheet_name='Print');
  proc print data=sashelp.class (obs=3) noobs
       style(header)={font_face='Courier New' fontsize=8pt fontweight=bold}
	   style(data)={font_face='Courier New' fontsize=8pt};
  run;
  
  ods tagsets.excelxp options(sheet_name='Report');
  proc report data=sashelp.class (obs=3)
       style(header)={font_face='Albany AMT' fontsize=8pt fontweight=bold}
	   style(column)={font_face='Albany AMT' fontsize=8pt};
  run;
  
  ods tagsets.excelxp options(sheet_name='Tabulate');
  proc tabulate data=sashelp.class;
    class sex age / style={font_face='Times New Roman' fontsize=8pt fontweight=bold};
    var height / style={font_face='Times New Roman' fontsize=8pt};
    classlev sex age / style={font_face='Times New Roman' fontsize=8pt fontweight=bold};
    table sex all,
	      age*n*{style={font_face='Times New Roman' fontsize=8pt}};
    keylabel n=' ' 
             all='Total';
	keyword all / style={font_face='Albany AMT' fontsize=8pt fontweight=bold};
    keyword n /style={font_face='Albany AMT' fontsize=8pt fontweight=bold};
run;
ods tagsets.excelxp close;

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
  • 3084 views
  • 0 likes
  • 2 in conversation