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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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