business intelligence vendor

InetSoft Technology: Example of a Report Event Handler

To illustrate the use of the event handler, we add two embedded request links. When a link is clicked on, it sends a CUSTOMIZE request to the replet, which sets the visibility of the report title.

View a five-minute Flash demo to get an overview of what InetSoft's business intelligence software, Style Intelligence, can do and how easy it is to use. KPI dashboard demo

 

 

 

 

 

public void init(RepletRequest req) throws
RepletException {
try {
// load the report template
InputStream input = getClass().
getResourceAsStream("/" + req.getParameter("templateName") + ".srt");
 
Builder builder = Builder.getBuilder(Builder.TEMPLATE, input);
report = (ReportSheet) builder.read(".");
// load data from data file
InputStream input2 =
getClass().getResourceAsStream("/data/education.csv");
 
ttl = new TextTableLens(input2,",");
ttl.setHeaderRowCount(1);
 
RepletParameters def =
new RepletParameters(RepletRequest.CUSTOMIZE);


def.addBoolean("Show Title", true);
 
def.addParameter("Title", "", null);
def.setVisible("Title", false);
 
RepletParameters def1 = new
RepletParameters(RepletRequest.CREATE);
def1.addParameter("Title", "", null);
 
def1.addBoolean("Show Title", true);
def1.setVisible("Show Title", false);
 
addRepletParameters(def);
addRepletParameters(def1);
 
EventHandler eh = getEventHandler();
RepletRequest q1 =
new RepletRequest(RepletRequest.CUSTOMIZE);
q1.setParameter("Show Title", new Boolean(true));
 
// the following call is equivalent to addRequest()
// except addRequest() also inserts commands to change
// the cursor to HAND when the mouse moves on the link
 
eh.addMouseClickCommand("ShowTitleLink", null,
RepletCommand.sendRequest(q1));
 
RepletRequest q2 =
new RepletRequest(RepletRequest.CUSTOMIZE);
q2.setParameter("Show Title", new Boolean(false));
eh.addMouseClickCommand("HideTitleLink", null,
RepletCommand.sendRequest(q2));
 
} catch(Exception e) {
e.printStackTrace();
throw new RepletException(e.getMessage());
}
}

We can then run the replet and click on the two links ('Show Title' and 'Hide Title') to make the report title visible/invisible.

 

Previous: Accessing the Report Event Handler Next: Server-Side Report Event Handling

More Resources:

  >> Setting Report Permissions
  >> Server Report API
  >> Server-side Reporting Features
  >> Self-service Reporting
 
Copyright © 2012, InetSoft Technology Corp.
InetSoft Technology reporting vendor
Ad Hoc Reports | Business Dashboard | Business Intelligence Analytics | Business Intelligence Solution | Business Reporting Software | Dashboard Metrics | Financial Reporting Software | KPI Software | OLAP | Operational BI | Performance Management System | Real Time Reporting | Web Based Reporting Tools