As the title says, I'd like to put a tab into the title or footnote of a spreadsheet coming out of ODS Excel.
Now this can be easily done with ODS RTF, e.g.:
ods escapechar='^';
title "^R/RTF""\tab"" ";
But I can't for the life of me work out how to do it for ODS Excel.
I know about {nbspace N} where N is the no. of spaces to insert,
(example: footnote "Version:^{nbspace 3}1";
but I really want tabs!
I also tried this:
footnote "Author:" '09'x "Fred";
but it had no effect.
Any help greatly appreciated!
Very interesting. Can you use white blanks to instead of TAB character ?
ods excel file='/folders/myfolders/x.xlsx' options(Embedded_Titles='yes') style=sasweb;
title "Title Title";
proc print data=sashelp.class;run;
ods excel close;
Why? Excel is a tabular system, it is not a word processor. Have you tried putting tabs into an Excel document directly - it is very difficult. If you need a nice report for review then use a format associated with review - RTF, PDF etc. If you need an Excel output then create an Excel output, if you need data then use a data transport format.
As a side note, I would never use tabs anywhere. The reason is there is no consistent spacing for them, so whatever application you render the output in may well change the look of the output. Spaces are far more controllable.
Mate
If you don't know the answer, just say so.
Here is how I code it using ODS Excel in EG7.1 on 9.4 platform:
ods _ALL_ close;
Ods noresults;
options leftmargin = .25in
rightmargin = .25in
topmargin = .75in
bottommargin = .5in
papersize=LEGAL
orientation=landscape
;
ods escapechar="~";
ods Excel
file="[filename].xlsx"
Author="A_Seratte"
style=SEASIDE;
proc print data = ... label noobs;
ODS Excel
options ( sheet_interval="BYGROUP"
sheet_name="#byval(office)"
...);
title2 BOLD "&L&[tab]" ;
var...;
by OFFICE ;
run;
ods Excel close;
ods listing;
ods results;
The&L left aligns it in Excel, though SAS will give you a warning or error message, and the &[tab] is straight from Excel. Comes out for me every time.
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.
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.