BIRT report with HBase Phoenix

Home Forums BIRT Reporting BIRT report with HBase Phoenix

This topic contains 0 replies, has 1 voice, and was last updated by  bulldog006 3 years, 8 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #1886


    My primary requirement is to use data in HBase for reporting in BIRT. What I have tried to do is tried to access HBase through Phoenix driver using Scripted datasource. This is what I have tried.

    1. Created a Java class file that access data from my HBASE cluster through Phoenix. Referred example from link:
    2. Instead of showing the fetched data in Console I created a method myPhoenixDatabase() that converts the data to JSON String and returns.
    3. In BIRT report, I used scripted datasource. In the script for dataset, I imported the package that has the class mentioned in (1) and (2), parsed the JSON array that is being returned from myPhoenixDatabase() and mapped them to my dataset fields.

    I have attached the report file, Java class and Maven POM file here. Below is a sample of the code.

    BIRT Dataset Script
    Open Method

    pe = new;
    var jsontext = pe.myPhoenixDatabase();
    myJSONObject = eval ("(" + jsontext + ")");
    len = myJSONObject.length; 

    Fetch Method

    if(count < len)
        var EmpID     = myJSONObject[count].EMPID;
        var Name   = myJSONObject[count].NAME;
        var Designation    = myJSONObject[count].DESIGNATION;
        row["EmpID"] = EmpID;
        row["Name"]= Name;
        row["Designation"]= Designation;
        return true;
    return false;

    1. This works fine only on the first execution after opening ECLIPSE. In subsequent runs the return value from the function was NULL and it throws error: “TypeError: Cannot read property “length” from null”.
    2. A weird workaround fixed this issue, calling the function twice, once from Open method of dataset script and second time from Afteropen method, fixed this issue.
    3. But still I am not able to get the report working from Tomcat server.

    I have uploaded the class, Maven POM and report files. Sorry for a long description. Any help would be much appreciated.

    • This topic was modified 3 years, 8 months ago by  bulldog006.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.