com.gestalt.scribe
Interface DrillDownReportListener
- public interface DrillDownReportListener
DrillDownReportListener must be implemented by those classes that wish to receive
the drill-down reports. The drill-down reports are produced by clicking on the mouse-sensitive fields
in primary reports; this triggers generation of the report by the server, and sending the results in
the form of a Vector, to the requesting client application.
The following code sample shows how the application can implements DrillDownReportListener to receive reports:
import java.io.*;
import javax.swing.*;
import com.gestalt.scribe.*;
public class Controller implements DrillDownReportListener
{
public static void main(String args[])
{
new Controller();
}
public Controller()
{
try // The Scribe server runs on host 192.168.1.12, listening on port 6541
{ // The calling app logs in as user "heidi", with password "hello"
Connector conn = new Connector("192.168.1.12", 6541, "heidi", "hello");
String reportName = "Customer";
Vector parameterList = conn.getReportParameters(reportName);
ParameterPacket packet = (ParameterPacket) parameterList.elementAt(0);
packet.setValue("VINET");
conn.displayReport(reportName, parameterList);
}
catch (ServerConnectionException e)
{
System.out.println(e);
}
}
/*
** Implementation of DrillDownReportListener interface. This method is called
** by Scribe API when the drill-down report is completed.
*/
public void displayReport(String reportName, Vector lines)
{
JFrame frame = new JFrame("Drill down (" + reportName + ")");
frame.addNotify();
frame.pack();
ReportPanel view = new ReportPanel(lines, reportName);
JScrollPane scrollPane = new JScrollPane(view);
frame.getContentPane().add(scrollPane);
frame.setSize(300, 400);
frame.validate();
frame.setVisible(true);
}
}
|
Method Summary |
void |
displayReport(java.lang.String reportName,
java.util.Vector lines)
|
displayReport
public void displayReport(java.lang.String reportName,
java.util.Vector lines)
Provides a hook for the Scribe API to send the completed drill-down report
to. The report is received by this method in a form of a Vector of objects
that mut be passed to ReportPanel in order
to be displayed.
- Parameters:
reportName - name of the drill-down report.
lines - a Vector of objects to be passed to ReportPanel.