Chart Triggers


The chart triggers are useful when you are trying to call an external process as a part of chart execution, for example, calling a web service hosted on a remote cloud application or calling a database procedure or calling a custom Java class to do some operation. The trigger login is written in XML format and pasted wither in "Before Chart Trigger Code" or  "After Chart Trigger Code". Sample XML codes are given below.




When you click on the trigger icon, it launches a screen to provide trigger inputs.


The trigger functionality has the below options:


      • Before the chart trigger code -> To execute the XML logic before the report is run.
      • After the chart trigger code -> To execute the XML logic after the report is run.


Firing the trigger before or after are just 2 radio buttons to select and send required information.

      • Fire After Query Formation
      • Fire Before Query Formation


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>".