Jump to content

BIRT Developer Center Download


Photo
- - - - -

report out of 2 dimensional json object

java json object 2 dimension

  • Please log in to reply
2 replies to this topic

#1 Elja

Elja

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 17 February 2017 - 01:34 AM

Hello.

I need help with the report I'm working on.

 

What I need is to obtain json object via URL, parse and create a report out of it. I've been using Oracle SQL and PostgreSQL before and I'm not a coder so this is beating me..

 

I'v searched for solution for quite a while now but haven't been able to solve the problems with getting info out of the json object.

 

There's a simple solution which I've used to practise with (example from kclark):

(http://developer.act...5&showentry=471)

 

Things done at the moment (following the example above):

1) I have created a scripted data source "Data source"

2) Then I created a scripted data set "Json_DS"

* The scripted "Data source" was selected as data source for the data set

* The output columns (name, title, phone) were created accordingly

* The Open and Fetch -scripts were added to Json_DS data set.

3) Json file was added to C:/tmp and the file location was updated into open-script:

.."C:/tmp/employee.json")..

 

But: even this simple example of reading and managing the json object produces an error:

"FAILED TO CREATE INSTANCE"

 

I checked this there shouldn't be a privilege problem with reading the file.

Could this be a problem with importPackages?

 

WHAT IS NEEDED?

I need to read a 2-dimentional json object via URL and create a report out of it.

IF possible, I'd need to read 3 json objects and mix them together in 1 excel file (3 tabs).

 

THE QUESTIONS:

1) Could I use the following example, (Answer #2)?

http://stackoverflow...-object-in-java

-> OR is there an easier solution available?

2) If the code above is used, should it be placed in data sets Open or Fetch script?

3) Could someone please show me an example how to construct this report (if not out of these parts, what sould be done)?

 

I attach a pic of the partial json object I'll use to create the report.

 

Please help, I'm running out of time and still have to figure out why I can't even make the simple example work..

Attached Files



#2 Clement Wong

Clement Wong

    Senior Member

  • BIRT Experts
  • 1165 posts

Posted 17 February 2017 - 03:24 PM

What version of BIRT are you using?

 

Have you seen this DevShare?

http://developer.act...ipted-data-set/

 

The example uses a scripted data source / data set to retrieve JSON data via URL.


Clement Wong
Principal Analytics Architect

OpenText Corporation
http://www.actuate.com | http://www.opentext.com


#3 Elja

Elja

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 20 February 2017 - 01:58 AM

Hello. I'm using Birt (Eclipse) 4.6.0.

The problem is that I'm not a coder (java/javascript) and I've been working with Oracle/PostgreSQL-reports until this recent report.

 

Json object handling with scripts is so different that I don't know where to place the scripts etc.

 

Thanks for your advice, I'll check the article you sent me!

 

- Elja