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.
The following table contains information about the methods you can use to create your own report.
Reporting Interface Methods
Name
Description
Default Abstract Report Implementation
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 window.
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.
StringBuffer getSourceCode();
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 code.
Not implemented.
void setDefaultMetadataObject(Root object);
An optional metadata object might be used when generating the report. This option only is set automatically by the report framework if the report category is set to “Table Analysis” or “External Table Analysis”. These reports are shown in the Analysis window, and the selected table or external table is used as the default object.
Sets a member variable.
Root getDefaultMetadataObject();
This method returns the optional metadata object or null.
Returns the member variable value that is set in the setDefaultMetadataObject method.
void setPath(String path);
The report designer can set a default path or allow the user to set the path in the Reports window. The report framework saves up to eight paths per client in the application default files. These paths are loaded at initialization and set to the first path displayed in the combo box.
Sets a member variable .
String getPath();
This method returns the default path if it is set by the report designer. This method is used by the Reports window to show that default path.
Returns the member variable value that is set in the setPath method.
Boolean isLocalBrowse();
This method returns true if the Browse button on the Report results pane in the Reports window brings up the local file system browser. This method returns false if the remote file system browser is used. This determination is based on the application server dialog box.
Returns false, so the remote file system browser is displayed based on the default application server selected.
void setFileName(String filename);
The report designer can choose to set the default filename to use when the report is created and saved.
Sets a member variable.
String getFileName();
This method returns the default filename. This method is used by the Reports window to show the default filename.
If the member variable in the setFileName method has not been set, then the returned name is the report name with all spaces removed and the type of ODS format selected (that is, html, .rtf, or .pdf).
Boolean isFileNameFieldEditable();
This method returns false if the user cannot change the filename. The report designer can turn off the user's ability to edit the filename.
Returns true.
String getURL();
This method returns the report URL.
Returns the fully qualified path and filename.
Boolean hasAnOptionsDialog();
This method returns true if the Additional report options button on the Reports window toolbar is activated.
Returns true.
void showOptionsDialog(ReportingController controller)
This method is executed when the user opens the Report Options dialog box for the selected report.
Shows the Report Options dialog box.
void setODSFormatType(String type);
This method is used only if the report is generated with SAS ODS and is using the default Report Options dialog box. This method is called when the user selects HTML, RTF, or PDF in the Format field on the Report Options dialog box. The default is set to HTML.
Sets a member variable.
String getODSFormatType();
This method returns the ODS format type that is selected by the user.
Returns the member variable that is set in the setODSFormatType method. If there is no format type set, then this method returns 'HTML' as the default.
void setODSStyleSheet(String cssFile);
This method is used only if the report is generated with SAS ODS and is using the default Report Options dialog box. This method is called if the user selects an ODS style sheet to be used with the report in the Style field on the Report Options dialog box.
Sets a member variable.
String getODSStyleSheet();
This method returns the ODS style sheet that is selected by the user.
Returns the member variable that is set in the setODSStyleSheet method.
void setODSAdditionalOptions(String addOptions);
This method is called by the Additional options field in the default Report Options dialog box.
Sets a member variable.
String getODSAdditionalOptions();
This method returns any additional ODS options that are set by the user to be used when generating the report.
Returns the member variable that is set in the setODSAdditionalOptions method.
String getReportingClass();
This method returns the fully qualified class name. This method is called to tie the report to the Reports window. One example is: com.sas.reports.TableReport.
Not implemented.