0
votes

I am trying to use the new ODS EXCEL instead of ODS Tagsets.Excelxp since I need .XLSX file. Everything works fine but I am getting trouble with the font: The code I used is:

ods Excel file="c/Profitability_ttm.xlsx" 
style= sasdocprinter
options(Sheet_Name="<1% >12%" 
Orientation= "landscape"
    embedded_titles='on');
title1 font=Arial h=10pt j=left Bold "Commercial Real Estate LOB";

I get the font size =10, left justified and Bold but the Font I get is Helvetica. The same code produces the Arial font when I use the ODS Tagsets.excelxp.

Is there anything I am missing in my code?

Any help will be very much appreciated.

1
What version of SAS do you have? If SAS 9.4TS1M2 or lower then it's still experimental.Reeza
I am writing a code on SAS E.G. 7.1shankar
SAS Version, not EG version. Use the following code to determine your SAS version if you don't know how: %put &sysvlong;Reeza
You only have code to set the font of the title. Does the title appear in Arial?Tom
@Reeza: it gives me 9.04.01M3P062415shankar

1 Answers

1
votes

I think you need to have the font installed on the machine where SAS runs. When I run using FONT=ARIAL on Windows it works. When I run it on SAS UE (so on a Linux virtural machine) it used Helvetica to replace Arial. But I can ask for other fonts like 'ITC Bookman' and it works. Try using 'Arial Unicode MS' instead of 'Arial' for the font.

Try using PROC QDEVICE to see what fonts are available.

Also SAS would not generate a working XLSX file on Windows until I used a value for the SHEET_NAME that did not include <>.

ods excel
  file="c:\downloads\font_test.xlsx" 
  style= sasdocprinter
  options (
    Sheet_Name="lt 1% gt 12%" 
    Orientation= "landscape"
    embedded_titles='on'
  )
;
title1 font='Arial Unicode MS' h=10pt j=left Bold "Commercial Real Estate LOB";
proc print data=sashelp.class;
run;
ods excel close ;