BookmarkSubscribeRSS Feed
TTNY
Calcite | Level 5

I use the 'title_foot_note_width' option when exporting to get my Title to span multiple columns, this however does not seem to work and my title appears truncated and only displayed in the first narrow cell of the output sheet. Here is my code;

 

Options nocenter;
title1 bold height=14pt color=red "NOT VALIDATED - FOR INTERNAL USE ONLY - NOT VALIDATED - FOR INTERNAL USE ONLY - NOT VALIDATED - FOR INTERNAL USE ONLY";
ods listing close;
ods noresults;
ods tagsets.ExcelXP style=seaside file="&output.\&OUTFILE."
options(sheet_name="test"
Embedded_titles = 'Yes'
autofilter='all'
frozen_headers='3'
title_footnote_width='5');
Proc print
data=everything noobs label
style(Header)=[background=#009FDA font_size=10pt just=center] ;
Run;

ods tagsets.ExcelXP close;
ods listing ;
title1;

 

Please find screen dump of truncated title below;truncated_title.jpg

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Its likely to be an Excel "feature".  When I run it the text is centered and so I see this:

Capture.PNG

 

Now, one way to fix it is to make the cells big enough to show the whole title, in my instance I updated my code to include (in proc report not print) the style= to make all the columns 5cm in width:

ods tagsets.excelxp file="s:/temp/rob/test.xml" options(sheet_name="test" embedded_titles = 'Yes' autofilter='all'
                                                        frozen_headers='3')  style=statistical;
title1 j=l bold height=14pt color=red "NOT VALIDATED - FOR INTERNAL USE ONLY - NOT VALIDATED - FOR INTERNAL USE ONLY - NOT VALIDATED - FOR INTERNAL USE ONLY";
proc report data=sashelp.class nowd style(column)=[cellwidth=5cm];
run;
ods tagsets.excelxp close;

 

If you have SAS 9.3 onwards you can use ods excel, which does seem to make this work correctly and wrap accordingly:

ods excel file="s:/temp/rob/test.xlsx" options(sheet_name="test" embedded_titles = 'Yes' autofilter='all'
                                               frozen_headers='3' title_footnote_width='5')  style=statistical;
title1 bold height=14pt color=red "NOT VALIDATED - FOR INTERNAL USE ONLY - NOT VALIDATED - FOR INTERNAL USE ONLY - NOT VALIDATED - FOR INTERNAL USE ONLY";
proc report data=sashelp.class nowd style(column)=[cellwidth=5cm];
run;
ods excel close;

 

Alternatively you could put the title in the titles section and change the view to print layout.  To be honest though, Excel is a spreadsheet, titles/footnotes are document items.

 

Edit: Note, if your still only still one word, you may need to put j=l after title1, e.g. title1 j=1 bold...

Otherwise it gets centered.

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
  • 1 reply
  • 1410 views
  • 0 likes
  • 2 in conversation