Sample 38100: Apply cascading style sheets to format ODS output
SAS® 9.2 introduced the new CSSSTYLE= ODS option which allows you to apply a cascading style sheet as an argument to control the formatting. Prior to SAS 9.2, only the ODS HTML or Markup destinations had the ability to use cascading styles sheets, which can use an external CSS file when specifying the STYLESHEET= option along with the URL= sub-option. Destinations such as ODS RTF and ODS PDF had to rely on template definitions prior to SAS 9.2.
Please see the code in the Full Code tab for an example.
The ability to apply cascading style sheets to destinations other than the Markup destination is specific to ODS, as the formatting is handled internally. The industry does not support cascading styles sheets for formats such as RTF and PDF. The style properties in the cascading style sheet files have to conform to our regular naming convention.
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.
SAS® 9.2 introduced the new CSSSTYLE= ODS option which allows you to apply a cascading style sheet as an argument to control the formatting. The sample code below illustrates this.
/* Create sample CSS file from the styles.normal template definition */
ods html stylesheet="c:\temp\test.css" style=styles.normal;
ods html close;
/* Apply CSS file to the PDF output */
ods pdf file="c:\temp\cssoutput.pdf" cssstyle="c:\temp\test.css";
proc print data=sashelp.class;
run;
ods pdf 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.
The CSSSTYLE= ODS option can be used to apply cascading style sheets for the formatting of ODS output.
Type: | Sample |
Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> RTF Third Party ==> Output ==> PDF Third Party ==> Output ==> HTML Third Party ==> Output ==> XML
|
Date Modified: | 2010-04-06 15:32:41 |
Date Created: | 2009-12-10 03:13:57 |
Operating System and Release Information
SAS System | Base SAS | Solaris for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
z/OS | 9.2 TS1M0 | |