Sample 38701: How to force the cell text to wrap when using the ExcelXP tagset
The default behavior is for cell text not to wrap when generating output using the ExcelXP tagset. If you are using at least Version 1.70 of the tagset, you can use the AUTOFIT_HEIGHT= tagset option to force the text to wrap. The AUTOFIT_HEIGHT= option must be specified in conjunction with setting the column width to force the cell text to wrap once the specified width has been reached.
The column widths can be set using the ABSOLUTE_COLUMN_WIDTH= tagset option or with the CELLWIDTH= style attribute.
Please see the code in the Full Code tab for an example.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to force the cell text to wrap when using the ExcelXP tagset.
/* The two variables are supplied a cell width using the */
/* ABSOLUTE_COLUMN_WIDTH= option along with the AUTOFIT_HEIGHT= */
/* option to wrap the cell text. */
data one;
input longtext1 $40. longtext2 $45.;
datalines;
This string will wrap at within a cell This string will wrap within a narrower cell
;
run;
ods tagsets.excelxp file="temp.xls" options(absolute_column_width="15,8"
autofit_height="yes" doc="help");
proc print data=one noobs;
run;
ods tagsets.excelxp close;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to force the cell text to wrap in Microsoft Excel when using the ExcelXP tagset.
| Date Modified: | 2010-04-28 15:34:53 |
| Date Created: | 2010-02-11 11:15:48 |
Operating System and Release Information
| SAS System | Base SAS | z/OS | 9.1 TS1M3 SP4 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |
| Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |
| Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |
| Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |
| Windows Vista | 9.1 TS1M3 SP4 | |
| 64-bit Enabled AIX | 9.1 TS1M3 SP4 | |
| 64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |
| 64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |
| HP-UX IPF | 9.1 TS1M3 SP4 | |
| Linux | 9.1 TS1M3 SP4 | |
| Linux on Itanium | 9.1 TS1M3 SP4 | |
| OpenVMS Alpha | 9.1 TS1M3 SP4 | |
| Solaris for x64 | 9.1 TS1M3 SP4 | |
| Tru64 UNIX | 9.1 TS1M3 SP4 | |