Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import JSON data from a REST API into BIRT?

Tags:

json

rest

birt

I want to use BIRT to generate reports against data that comes from a JSON based REST API. How can I import this data?

like image 628
Phyxx Avatar asked Jan 09 '13 04:01

Phyxx


People also ask

How does REST API send JSON data?

To post JSON to a REST API endpoint, you must send an HTTP POST request to the REST API server and provide JSON data in the body of the POST message. You also need to specify the data type in the body of the POST message using the Content-Type: application/json request header.

How does JSON work with API?

How JSON API Works. The user and the server send a data request in the API. The API then designates how the data will be called using the GET method and the affiliated links shared. A JSON object then retrieves data and outputs either an error message or shows data depending on the user request.

What is JSON API integration?

JSON API lets you integrate any external tool with Collaborator. To do this, you need to exchange data between your application and your Collaborator server. To use the web service you need to send requests to web service endpoint URL and receive responses from it.

Is a JSON file an API?

JSON API is a format that works with HTTP. It delineates how clients should request or edit data from a server, and how the server should respond to said requests.

How to import data from JSON to Power BI REST API?

Then you have to expand the table containing JSON records to create one column for each property in a record. With power BI REST APIs, you can import data from a remote location in the form of a JSON file and then explore the data just as you would a local JSON file.

What is a JSON REST API?

REST (Representational State Transfer) is an architectural style and is an approach to communications between different modules often used in the development of web services. In this blog, I will describe how you can use JAVA to leverage JSON data from a REST API.

How do I import data from a REST API into Neo4j?

Before importing data from a JSON-based REST API you should have installed the APOC library. There are a plethora of JSON-based Web APIs that we can import into Neo4j, and we can use one of the Load JSON procedures to retrieve data from these APIs and turn it into map values ready for Cypher to consume.

What is json JSON in Power BI?

JSON stands for JavaScript Object Notation and is one of the most commonly used formats for data exchange between different platforms and applications. With Power BI, you can export data from JSON files to create different types of visualization.


1 Answers

The process for doing this is described at http://developer.actuate.com/community/forum/?app=blog&blogid=45&showentry=471, but it turns out that there are a few important steps missing. I'll fill in a few blanks here.

The original instructions describe creating a Scripted Data Source, with an "open" script that makes use of the com.actuate.json.JSONParser class. First, it is important to realise that this class is not part of BIRT, and needs to be manually added (along with any dependencies).

The download provided by the original instructions provides the com.actuate.json.JSONParser class, but leaves it up to you to source the dependencies. To make things easier I have reimplemented the JSONParser library in Maven, which will then download and package the dependencies for you. It also includes some bug fixes and enhancements like GZIP compression support. You can get the Maven project from https://github.com/mcasperson/birt-jsonparser, and to build the JSONParser library and package the dependencies, run the command

mvn clean package dependency:copy-dependencies

This will result in the birt-jsonparser-0.0.1-SNAPSHOT.jar file being created in the target directory, and all the dependencies copied into the target\dependency directory. Copy all of these JAR files into the {BIRT_INSTALL}/plugins/org.eclipse.birt.report.viewer_{BIRT_VIEWER_VERSION}/birt/scriptlib directory to allow the JSONParser class to be accessed from within your BIRT report.

If you want to debug your report, these JAR files will also have to be referenced in the Debug profile.

enter image description here

like image 189
Phyxx Avatar answered Oct 13 '22 11:10

Phyxx