.addSourceCode( " created = &etls_create\n" )
.addSourceCode( " modified = &etls_modified\n" )
.addSourceCode( " owner = &etls_owner\n" )
.addSourceCode( " schema = &etls_schema\n" )
.addSourceCode( " group = &etls_group\n" )
.addSourceCode( " checkout = &etls_checkout\n" );
codeGen.addSourceCode( "run;\n\n" );
codeGen.addSourceCode( "ods ")
.addSourceCode( getODSFormatType() )
.addSourceCode( " close;\n\n" );
codeGen.addCommentLine( "Cleanup" );
codeGen.addSourceCode( "filename request;\n" );
codeGen.addSourceCode( "filename response;\n" );
codeGen.addSourceCode( "filename map;\n" );
return codeGen.getSourceBuffer();
}//end method
}//end class
Reporting Interface Methods
New report plug-ins need to implement com.sas.wadmin.plugins.ReportingInterface,
which is an extension of the com.sas.plugins.PluginInterface. Implementation of each of
the methods in the Reporting Interface allows the report designer to have control over
the Reports window. The onSelected() method can be used to generate a report by using
Java classes or display dialog boxes to gather additional information needed for the
generated source to run. The getSourceCode() method returns the SAS code that is
submitted to the SAS application server, or it returns null if no code is being used to the
generate the report.
To add a report to the Analysis window for tables the category needs to be Table
Analysis. When running in the Analysis window, the reporting framework supplies the
selected default table to your report. When the report is run in the Reports window you
need to supply a table. You can add code to the onSelected() method to check if the
default metadata object is null. If it is, then you can display a dialog box that allows the
user to select the table. If you want to add a report to the external table Analysis window,
then the category needs to be External Table Analysis.
An abstract implementation of the reporting interface has been provided called
com.sas.wadmin.reports.AbstractReport. AbstractReport provides some default
implementations of the interface methods. It assumes that the report is being generated
with SAS ODS, and the Output Delivery System Report Options dialog box is being
used. The following table shows the main interface methods, explains how they work
with the Reports window, and gives a short description of how AbstractReport has
implemented the methods. For an example of how these methods can be used to create a
report, see “Example Java Code for a Report Plug-in” on page 763.
The following table contains information about the methods you can use to create your
own report.
Reporting Interface Methods 769
Table A4.1 Reporting Interface Methods
Name Description
Default Abstract Report
getName(); This method returns the
report name and is displayed
in the Name column of the
Reports window.
Not implemented.
getDescription(); This method returns the
report description and is
displayed in the Description
column of the Reports
Not implemented.
String getCategory(); This method returns the
category that the report uses.
The report category is
displayed in the Reports
window under the heading
Type. The user can also
choose to show reports based
on the category name.
Not implemented.
This method returns the
generated SAS code that can
be used to generate a report.
Code returned by this method
is submitted to the
application server by the
report framework. If code is
not being used to generate the
report, then this method
returns null.
Not implemented.
void onSelected(); This method executes when
the user runs the selected
report before submitting any
SAS code to the application
server that is returned by the
getSourceCode() method.
This method can be left
empty for reports that do not
contain any visual elements,
or whose processing is done
solely with generated SAS
Not implemented.
770 Appendix 4 Java Code and Methods for Report Plug-ins

Get SAS Data Integration Studio 4.9 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.