Problem Note 46949: You cannot use a style template with the ExcelXP tagset to add grid lines to the body of a worksheet
Adding grid lines to the body of a worksheet in an Excel file generated with the ExcelXP tagset does not work in SAS® 9.2. This could be accomplished in earlier releases of SAS by making the background transparent in a style defined with PROC TEMPLATE.
To circumvent the problem, you can use PROC TEMPLATE to create a custom tagset to preserve the grid lines in output generated with the ExcelXP tagset. The example code on the Full Code tab illustrates this.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
Windows Vista for x64 | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The example code below uses PROC TEMPLATE to create a custom tagset to preserve the grid lines in output generated with the ExcelXP tagset.
/***********************************************************/
/* Compile tagset Tagsets.ExcelXP_mod, which makes changes */
/* to the ExcelXP tagset to preserve the grid lines. */
/***********************************************************/
proc template;
define tagset tagsets.excelxp_mod;
parent=tagsets.excelxp;
define event sub_body;
break /if $sub_body;
set $sub_body "True";
set $body_class "_body";
put '<Style ss:ID="_body">' nl;
put ' <Font ss:FontName="Arial, Helvetica, sans-serif" ss:Size="10" ss:Color="#003399" />' NL;
put "<Interior />" Nl;
put '</Style>' nl;
set $contents_class "_contents";
put '<Style ss:ID="_contents">' nl;
put ' <Interior ss:Pattern="Solid" />' nl;
put ' <Protection ss:Protected="1" />' nl;
put '</Style>' nl;
set $pages_class "_pages";
put '<Style ss:ID="_pages">' nl;
put ' <Interior ss:Pattern="Solid" />' nl;
put ' <Protection ss:Protected="1" />' nl;
put '</Style>' nl;
end;
end;
run;
/* Remove table borders */
proc template;
define style styles.test;
parent=styles.minimal;
style table from table /
cellspacing=0
borderwidth=0;
end;
run;
/* Use new tagset along with the new style. */
ods tagsets.excelxp_mod file="c:\temp.xml" style=styles.test;
proc print data=sashelp.class;
run;
ods tagsets.excelxp_mod close;
You cannot use a style template to add grid lines to the body of a worksheet with the ExcelXP tagset in SAS® 9.2.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2012-07-17 14:07:51 |
Date Created: | 2012-07-10 07:06:27 |