Example of connecting to ElasticSearch using BIRT with a Scripted Data Set

Clement Wong
Clement Wong E mod
edited February 11, 2022 in Analytics #1
Here is a very simple example of BIRT connecting to ElasticSearch using a Scriped Data Set. This could also illustrate connecting to a REST based data source with a JSON result set.<br />
<br />
The three events were added:<br />
<br />
Data Source > Open
<br />
Make a query request to ElasticSearch<br />
Save the results in a JSON variable
<br />
<br />
Data Set > Open
<br />
Reset the row counter to zero
<br />
<br />
Data Set > Fetch
<br />
Create a row of data from ElasticSearch for each “hit”<br />
Set the output column field values from the JSON result set<br />
Stop when total hits are reached
<br />
<br />
<br />
Place the helper JavaScript, “json.js”, into the root of the project folder.<br />
<br />
Note: If you are using BIRT 4.5.0, it has built-in JSON support so you don't need the helper JavaScript file, "json.js", in the root of your project folder. The difference between the two designs in the ZIP is that the one for pre-BIRT 4.5.0, there is an external Resources reference to "json.js", and the one for 4.5.0 does not have it. If you don't have it in pre-BIRT 4.5.0, when attempting to run the report, you will see an error like ... ReferenceError: "JSON" is not defined.
Warning No formatter is installed for the format ipb

Comments