03-15-2017 04:33 PM
Can any one explain a work around to this issue where the wraptext:no ( or wrap:no) style attribute does not stop ODS EXCEL from wrapping fields (i.e. inserting line feeds).
proc format; value EDUCLAM 16 = '4 YEARS OF COLLEG 4 YEARS OF COLLEGE' 17 = '1 YEAR OF GRAD SC 1 YEAR OF GRAD SCHOOL' 18 = '2 YEARS OF GRAD S 2 YEARS OF GRAD SCHOOL' 19 = '3 YEARS OF GRAD S 3 YEARS OF GRAD SCSCHOOL' 20 = '4 OR MORE YEARS O 4 OR MORE YEARS OF GRAD SCHOOL' ; run; data nowrap; infile datalines; input edu; format edu EDUCLAM.; datalines; 16 17 20 ; run; ods excel file="d.xlsx"; PROC TABULATE DATA=WORK.NOWRAP ; VAR edu/ style=[tagattr='wraptext:no']; /* VAR edu/ style=[tagattr='wrap:no'];*/ TABLE edu,(min Median max)*F=EDUCLAM.; run; ods excel close;
03-16-2017 08:04 AM - edited 03-16-2017 08:05 AM
Seems like we're giving SAS a reason not the wraplines rather than it not wrapping lines because we used tagattr='wraptext:no'? Indeed, it *is* closer; I can see now that I can force the column widths with the ODS statement. It's not very satisfying, but thanks for the response.
03-16-2017 01:02 PM - edited 03-16-2017 01:06 PM
VAR edu/ style=[width=100%];
@LaurieF, right, just tried it with this line. If one uses no wraptext style command but one uses the width command, same result, no wrapping occurs. What's happening is that no line feeds are being added to the lines of text. This is a forced line wrapping imposed by the ODS system (maybe?) before Excel appies its own wrapping.