BookmarkSubscribeRSS Feed
saul_kanowitz_cdph_ca_gov
Calcite | Level 5

Here is the code I am using for my inline italicizing for a footnote in preparation for a proc print using ods to an xml file for use in excel.

footnote j=left height=8pt "Note: Denominators for computing rates are from the California Department of Finance, \{style [font_style=slant color=red] E-2 California County Population Estimates and Components of Change.}";

The color=red works, which I don't care about. I was just trying to make sure I had syntax correct. I have tried font-weight=italic, font_style=italic, just italic and I can't seem to get the later half of this footnote to italicize. It prints red, but not italic.

Any solution would be greatly appreciated.

5 REPLIES 5
Tim_SAS
Barite | Level 11

ods escapechar='\';

title 'Example for footnote';

footnote j=left height=8pt "Note: Denominators for computing rates are from the California Department of Finance, \{style [fontstyle=italic color=red] E-2 California County Population Estimates and Components of Change.}";

proc print data=sashelp.class(obs=5);

run;

FONTSTYLE=

Tim_SAS
Barite | Level 11

Going back to the original post, OP says "using ods to an xml file for use in excel". I interpret this to mean the ODS TAGSETS.EXCELXP destination.

I have since learned that FONTSTYLE=ITALIC doesn't work with Excelxp. Excelxp's support for inline formatting is limited to foreground color, font, font weight, and text decoration.

Sorry if my previous post caused any confusion.

saul_kanowitz_cdph_ca_gov
Calcite | Level 5

Thanks for help and subsequent clarification. Appreciated.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

I would suggest you switch to the HTML engine.  The reason is that you are actually writing out XML text data, which Excel then interprets and I don't believe it will parse tags within the actual data, so you wouldn't be able to change part of a cell's font.  You could change the whole cell with tagattr={"italic=1"} or something along those lines (I can never remember off the top of my head).  Although, why not switch output destinations to a reporting format, PDF or RTF for instance rather than Excel output.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1655 views
  • 0 likes
  • 3 in conversation