The
traditional method for creating a custom report without creating a
data set is called DATA _NULL_ report writing. With the ODS Report
Writing Interface (RWI), you can create highly customized reports
in an object-oriented language that is fully integrated with ODS.
The ODS RWI does the following:
-
fully embraces ODS features such
as proportional fonts, trafficlighting, colors, images, and Unicode
characters, while at the same time providing pixel-perfect placement
capabilities
-
takes advantage of the programming
features that the DATA step offers, such as conditional logic, formatting
capabilities, BY-group processing, and arrays
-
uses an object-oriented language
that provides you with flexibility and control so that even the most
rigid reporting requirements can be met easily.
The following example uses the RWI to create a cover
letter:
ods html close;
options nodate nonumber;
title;
ods escapechar="~";
footnote "~{style [font_size=10pt just=right color=cxbbb2e0]Provided to you by
SAS 9.4 and ODS Absolute Layout features.}";
proc template;
define style Styles.Orionbackground;
parent=Styles.Printer;
style body /
background=cx494068;
end;
run;
ods pdf file="ExecutiveSummary.pdf" style=Styles.Orionbackground notoc;
data _null_ ;
dcl odsout trt();
trt.layout_absolute();
trt.region(y: "2in");
trt.format_text(data: "Orion Star", just: "c",
style_attr: "color=cxbbb2e0 just=center font_size=72pt");
trt.region(y: "3in", x: "3in");
trt.format_text(data: "Sports & Outdoors",
style_attr:"color=cxbbb2e0 font_size=28pt");
trt.region(y: "5in");
trt.format_text(data: "Executive Prospectus",
just: "c",
style_attr:"font_size=36pt color=cxbbb2e0");
trt.region(y: "7in");
trt.format_text(data: "For years 1999 through 2002",
just: "c",
style_attr:"font_size=20pt color=cxbbb2e0");
trt.layout_end();
run;
ods pdf close;
Cover Page Created with the RWI
The RWI enables you
to create and manipulate predefined ODS objects in a DATA step. ODS
objects are data elements that consist of attributes, methods, and
operators. Attributes are the properties that specify the information
that is associated with an object. Methods define the operations that
an object can perform. You use the DATA step object dot syntax to
access the component object's attributes and methods. You can
use the RWI’s object-oriented functionality to create highly
specialized reports. The RWI is available for PRINTER and HTML destinations.
For complete documentation
about the RWI, see Introduction to the Report Writing Interface in SAS Output Delivery System: Advanced Topics.