Your application must handle Drill-out events that a thin crosstab or a thin table generates. The thin GridView
objects do not generate Drill-out events unless you place drill-out images in the thin GridView
. The Drill-out event for a header is the BIConstants.HEADERDRILL_EVENT
, and the Drill-out event for the databody is the BIConstants.DATADRILL_EVENT
.
In the GridView, call setGraphicImagePath
to specify the image to display in a cell from which the user can drill out.
Create a ViewStyle
, and call its setGraphicImageIndex
method to specify the index in which you stored the graphic image path.
Use rules to specify the cells in which the drill-out image should appear.
You can respond to a Drill-out event in one of two ways:
To direct a Drill-out event to another page in your application, set a GridViewDataListener
with the ThinGridView
. In the listener, specify the page in your application to which the event should be directed.
To direct a Drill-out event to another application, server, or Web site, register a DrillOutCallback
with the ThinGridView
. In the callback, provide the URL to which the Drill-out event should go. The ThinGridView
will place that URL in the HTTPResponse
.
The following code shows a simple GridViewDataListener
implementation. This example assumes that the application page to which you send the Drill-out event uses the location information to determine how to respond.
public class GridViewListener implements GridViewDataListener{ public void viewHeaderDrillOut(HeaderDrillOutEvent e){ // call application method that gets the location and // displays the appropriate page goToHeaderDrillOutPage(e.getEdge(), e.getDepth(), e.getIndex()); } public void viewDatabodyDrillOut(DatabodyDrillOutEvent e){ // call application method that gets the location and // displays the appropriate page goToDataDrillOutPage(e.GetColumn(), e.getRow()); }
The following code shows how to register the GridViewDataListener
with your ThinGridView
. This code assumes that gridview
is an existing ThinGridView
.
gridview.addGridViewDataListener(GridViewListener);
The following example shows a simple DrillOutCallback
implementation. This example assumes that the application to which you send the Drill-out event uses the location information to determine how to respond.
public class DrillCallback implements DrillOutCallback{ public String getHeaderDrillOutURI(ThinGridView gridView, int edge, int layer, int slice){ return "http://www.mycompany.com?" + "edge=" + edge + "&layer=" + layer + "&slice=" + slice; } public String getDataDrillOutURI(ThinGridView gridView, int row, int column){ return "http://www.mycompany.com?" + "row=" + row + "&column=" + column; } }
The following code shows how to register the callback with a ThinGridView
. This code assumes that gridview
is an existing ThinGridView
.
gridview.setDrillOutCallback(DrillCallback);