Sample 35781: Prevent a line break character from creating a new row in Excel when using the MSOffice2K destination
When a physical line break is added using the MSOffice2K destination, the line that is output might go to a new row in the Excel worksheet. The new row is introduced by the <BR> HTML tag.
To prevent the new line from going to a new row in the Excel output, a Microsoft Office-specific style sheet property can be used. The MSO-DATA-PLACEMENT style sheet property is responsible for determining whether the new line goes to a new row. Specifying the value "same-cell" as the value for this style sheet property will override the default, which is to add a new row of data in the worksheet with the new line.
See the sample code on the Full Code tab for an illustration.
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.
The HEADTEXT= option is used to add the MSO-DATA-PLACEMENT style sheet property to the header of the file, preventing the label AGE from adding three new rows in the worksheet.
ods msoffice2k file="c:\temp\temp.xls"
headtext="<style> br {mso-data-placement:same-cell}<style>";
proc report data=sashelp.class nowd split="*";
define age / order "first*second*third";
define name / order;
define height / sum;
define weight / sum;
run;
ods msoffice2k 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 prevent a line break character from creating a new row in Excel when using the MSOffice2K destination.
| Date Modified: | 2009-05-05 11:17:33 |
| Date Created: | 2009-05-04 10:18:04 |
Operating System and Release Information
| SAS System | Base SAS | Linux | | |
| HP-UX IPF | | |
| IRIX | | |
| HP-UX | | |
| AIX | | |
| 64-bit Enabled Solaris | | |
| 64-bit Enabled HP-UX | | |
| 64-bit Enabled AIX | | |
| Windows Millennium Edition (Me) | | |
| Microsoft Windows XP Professional | | |
| Microsoft Windows Server 2008 | | |
| Microsoft Windows Server 2003 Standard Edition | | |
| Microsoft Windows Server 2003 Enterprise Edition | | |
| Microsoft Windows NT Workstation | | |
| Microsoft Windows 2000 Professional | | |
| Microsoft Windows 2000 Server | | |
| Microsoft Windows 2000 Datacenter Server | | |
| Microsoft Windows 2000 Advanced Server | | |
| Microsoft Windows 95/98 | | |
| OpenVMS VAX | | |
| ABI+ for Intel Architecture | | |
| Microsoft Windows Server 2003 Datacenter Edition | | |
| OS/2 | | |
| Microsoft® Windows® for x64 | | |
| Microsoft Windows XP 64-bit Edition | | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
| z/OS | | |
| Windows Vista | | |
| Linux for x64 | | |
| Linux on Itanium | | |
| OpenVMS Alpha | | |
| OpenVMS on HP Integrity | | |
| Solaris | | |
| Solaris for x64 | | |
| Tru64 UNIX | | |