Report Triggers


Report triggers are useful to call an external process as a part of report execution. The trigger login is written in XML format and pasted either in Before Report Trigger Code or After Report Trigger Code.

To enable a trigger:

  1. Click Edit for the report.
  2. Click Advanced to display a list of icons.
  3. Click Trigger to display the Triggers window.



  1. Use the radio buttons to select whether the trigger should be activated before the query formation or after the query formation.
  2. Paste the XML code in the corresponding fields. Pasting the XML code in Before Report Trigger Code will execute the trigger code before the execution of the report. Pasting the XML trigger code in the After Report Trigger Code will execute after completing the report execution.
  3. Click Save.



XML Logic Samples




XML Logic Writing Tips


  • Include the tag "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" on the top portion.
  • Write the parent tag "<triggers>" to include all the trigger logic inside.
  • The user can include multiple triggers inside the "<triggers>" tag.
  • Each trigger is given a sequence number like 1, 2, 3, etc.


To write a trigger for web service call, follow the below steps:


  • First, write the "<trigger seq='1' type='REST' method="POST">".
    • Change the type to match web service, either it may be "REST" or "SOAP".
    • Change the method to match the destination web service method, either "POST" or "GET".


  • Second, put the web service end-point url in "<url>" tag.
  • Third, include the parameters in the "<parameters>" tag if any.
    • To include the parameter, use "<param seq="1" datatype="TEXT" name="uname">":param1"</param>".
    • seq is for the order of parameter.
    • datatype is the type of data passed as parameter.
    • name is the equal to the remote parameter name.
    • ":param1" is any constant value or value from user input.
  • Close the "</trigger>".


To write a trigger for calling a Database procedure, follow the below steps:


  • First, write the "<trigger seq='1' type="sql">". Type is "sql".
  • Second, put the database procedure call in "<sql>" tag.
  • Close the "</trigger>".


To write a trigger for calling Java class method follow the below steps:


  • First, write the "<trigger seq='3' type='java' method="printHello">".
    • Change the type to "java".
    • Change the method to match the destination method in the java class.
  • Second, put the full qualified path to the java class in "<class>" tag.
  • Third, include the parameters in the "<parameters>" tag if any.
    • To include the parameter use "<param seq="1" datatype="TEXT" name="uname">":param1"</param>".
    • seq is for order of parameter.
    • datatype is type of data passed as parameter.
    • name is equal to the remote parameter name.
    • ":param1" is any constant value or value from the user input.
  • Close the "</trigger>".


Trigger Based Reports Supporting Multiple Database Connector


Supporting multiple database connectors in trigger based reports. Based on the database connector name will write corresponding SQL statements and those SQL statements will execute in which database connector used for report creation. In dbname attribute database connector name will be case insensitive and It is optional when user has only one SQL tag, then it will take the report database connector.



To write the trigger for supporting multiple database connector sample xml:

<triggers>

     <trigger seq='1' type='sql'>

<sql dbname = “oralce”><![CDATA[begin xxeis.eis_rs_process_reports.g_as_of_date:=":As of Date"; end;]]></sql>

<sql dbname = “mysql”><![CDATA[begin xxeis.eis_rs_process_reports.g_as_of_date:=":As of Date"; end;]]></sql>

     </trigger>

</triggers>