. Use BIRT to generate reports from MongoDB

Provide current MongoDB data to your embedded analytics.

esProc integrates MongoDB APIs in an external library, and you can connect to MongoDB with the following simple operations. You can use the esProc with the BIRT (Business Intelligence Reporting Tools) platform to create BIRT reports that reflect changes to your MongoDB data in real time.

1.Install the esProc.

2.Download esProc external libraries, put them in [installation directory]\esproc folder, unzip extlib.zip .

3.Download bson-3.6.3.jar, mongo-java-driver-3.6.3.jar(Get the appropriate jars according to the MongoDB version you are using.) from the web and put them in [installation directory]\esProc\extlib\MongodbCli folder. 

4.Develop SPL Script in esProc IDE. esProc provides mongo_open(),mongo_shell() and mongo_close()to access the MongoDB. For example(Find out the record that is greater than the mean value after calculating the average grade by student number.),
SPL Script(meanValue.dfx)


A

1

=mongo_open("mongodb://127.0.0.1:27017/raqdb")

2

=mongo_shell(A1,"course.find(,{_id:0})")

3

=A2.group(Sno).((avg =~.avg(Grade), ~.select(Grade>avg))).conj()

4

=mongo_close(A1) 

5.Call SPL Script in BIRT. Integrate esProc JDBC with BIRT report designer - put the necessary jars and configuration files in BIRT’s corresponding directory. Create a new report and add esproc JDBC data source. Create a new data set on New Data Set window and select the esProc JDBC data source. The data set type is SQL Stored Procedure Query. The query is:{call meanValue.dfx()}.

View the report in web viewer.

Sno

Cno

Grade

200810121

1.0

96.0

200810121

2.0

93.0

200810122

3.0

90.0

200810123

2.0

76.0

Your BIRT reports can now pick up any updates to MongoDB data. For detail information, see How to Call an SPL Script in BIRT.

With the help of esProc SPL, we can conveniently handle structured data processing in MongoDB. For more examples, read esProc-driven MongoDB HackersSimplifying MongoDB Data Association, and How SPL Assists MongoDB Calculation.

For many difficult calculations of MongoDB, you can refer to SPL assists MongoDB calculation.

For specific usage, please refer to   Getting started with esProc