BookmarkSubscribeRSS Feed
KonstantinVasil
Obsidian | Level 7

 

Using the code below, the resulting font is Helvetica. To my eye the fonts are indistinguishable in Excel, however, it is important to have the font set to Arial.

 

proc template;
	define style mystyle; 
		class header, footer, data/ fontfamily = "Arial" fontsize= 14pt	bordercolor = black borderstyle = solid	;
		class systemtitle / fontfamily = "Arial" fontsize= 14pt textalign=left;
end; 

ods excel file= "&excel_export_path." style=mystyle options(start_at="2,1" embedded_titles="yes" sheet_interval="none");
	proc report data=sashelp.class  SPLIT='|' spanrows ;
		column (Sex Name Weight);
	run; 
ods excel close;
3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:

  That's not what I observe when I do this:

arial_used_ods_excel.png

 

Perhaps there is something wrong with your template. Since I can see that Arial works in a simple style override, there's a workaround for you and so, no need for a template. If you are wedded to the template idea, then you may have to work with Tech Support on why your template didn't work as you wanted.

 

Hope this helps,

Cynthia

KonstantinVasil
Obsidian | Level 7

Thank you.

 

The reason I have this as a template is because I want it to be a global setting for everything inside the ods excel, not just for a particular report/row/column. Is there a work-around for this?

Cynthia_sas
Diamond | Level 26
Hi:
Well, a style template will apply to ANY destination, where you use it. Not just ODS Excel. And it will not be global for everyone, unless you make the style template in an item store where it is available to everyone. So implementing a "global" style will be hard if it is for more programmers than just you.

However, if you need help with a template, I suggest opening a track with Tech Support. I think it's just an issue of specifying fonts in the wrong place or the wrong way, but I'm not in a position to test code for the rest of the day.

Cynthia

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch 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
  • 3 replies
  • 6031 views
  • 0 likes
  • 2 in conversation