I am trying to do several things... 1 I want to underline my first title in Proc Report..... Second a blank line between Title1 and Title2 ... Currently using SAS 9.1.3, and latest excelxp tagset.
ods tagsets.ExcelXP
style=minimal
file = "P:\Analytics\Meta_Partner_Report\chritest.xlm";
ods tagsets.ExcelXP
options(default_column_width="20, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10"
width_fudge='0.75'
EMBEDDED_TITLES = 'yes'
AUTOFIT_HEIGHT = 'yes'
bordercolor = 'yes'
FITTOPAGE = 'yes'
orientation = 'landscape'
frozen_headers='4'
Pages_FitWidth = '1'
Pages_FitHeight = '100'
sheet_interval='none'
sheet_name='PASNAP Frontpage');
* WORKSHEET 1 - FRONTPAGE;
title;
title1 Underline f='Myriad' h=18pt c=black bc=CXA9CC38 "PA SNAP Report";
title2 f='Myriad' h=18pt bc=CXA9CC38 "PA SNAP Summary of Results by List Source";
proc report nowindows data = Xl_pasnap_frontpage split='*'
style(header)=[background=CX152E5F font_face=Myriad font_size=14pt foreground=cxffffff];
column PA_Type Total_Outreach Total_Unique_Outreach Responded SNAP_Initiated SNAP_Submitted
Secondary_Submitted PA_SNAP_Submissions_Grand_Total;
define PA_Type/"PA SNAP Type";
define Total_Outreach/"Total Outreach";
define Total_Unique_Outreach/"Unique Outreach";
define Responded/"Unique Responses";
define SNAP_Initiated/"Initiated";
define SNAP_Submitted/"Submitted";
define Secondary_Submitted/"Secondary Submissions";
define PA_SNAP_Submissions_Grand_Total/"Project Total Submissions";
run;
Underline=1 , 2 or 3 to set the line thickness for the underline, must specify one of these values. You should have been getting a Warning about ambigous title options.
Clear title2 and use your current text for Title3 to get a line between titles.
Unfortunately that does not appear to work for me... is the correct word underline or underlin? Is there a specific order that the title statement attributes must follow? (font first etc... )
FWIW Running Sas 9.1.3 and latest excelxp tageset
If this becomes problematic I am going to resort to writing DDE to change the font size etc. But I would rather not. I am already doing screwy things like saving the xlm file as an xlsx file, inserting graphics and progrmatically changing the templet for the conversion program in excel 2007 to get custom colors recognized in earlier versions of excel.
Hi: I only have 9.4 to write code with. Unless you find someone who has 9.1.3 to work with your code, your best bet may be with Tech Support. I do not actually know whether the Underline option is supported in the TAGSETS.EXCELXP destination. For example, when I simplify your code, in SAS 9.4, the UNDERLINE option works for HTML but not for TAGSETS.EXCELXP destination. I suspect this is because the UNDERLINE option writes something not respected by Excel. On the other hand, the method 2 code does work in both Excel and HTML, using ODS ESCAPECHAR and a STYLE override using TEXTDECORATION attribute. See attached screenshots.
Cynthia
ods _all_ close;
** 1) use UNDERLINE;
ods html file='c:\temp\testht_title1.html' style=sasweb;
ods tagsets.ExcelXP file='c:\temp\testxp_title1.xml'
options(EMBEDDED_TITLES = 'yes' ) style=sasweb;
title1 underline=1 '1) First Title';
title2 ' ';
title3 underline=1 'Title after Blank';
proc print data=sashelp.class;
run;
ods _all_ close;
title;
**2) use ODS ESCAPECHAR;
ods html file='c:\temp\testht_title2.html' style=sasweb;
ods tagsets.ExcelXP file='c:\temp\testxp_title2.xml'
options(EMBEDDED_TITLES = 'yes' ) style=sasweb;
ods escapechar='^';
title1 '^{style[textdecoration=underline]2) First Title}';
title2 ' ';
title3 '^{style[textdecoration=underline]Title after Blank}';
proc print data=sashelp.class;
run;
ods _all_ close;
title;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.