Trying to fill a report with Oracle data

75 views
Skip to first unread message

javiermm...@gmail.com

unread,
Mar 3, 2017, 3:43:14 AM3/3/17
to Fujitsu RunMyProcess Developer Community
Hi,


I was thinking in show some data in an Oracle database in a Report widget, however I'm thinking how to get it.
First, let's assume I have configured a connector with JDBCAdapter using SEC, (That's in process).
Now, let's guess I have a CAPI which is using the JDBC connector and is returning a result in the form mentioned in the doc:
{
"SECStatus":200,
"DBData":{
"result":"success",
"data":[
{"birth":"1996-02-05","death":"2010-06-06","name":"Pancho","owner":"Malcolm","specie":"dog"},
{"birth":"1999-04-09","death":"2012-08-09","name":"Skeff","owner":"Malcolm","specie":"dog"},
{"birth":"2012-03-01","death":null,"name":"Tuffy","owner":"Axel","specie":"hamster"}
],
"rows":3
}
}
(for example)

Now, How can I set this data into a report widget?
I've tried building my own data an using setData method but I'm not sure how to configure de report widget.
I fear a JS report will be needed, but I would like to know if is there another solution.
I read an option saving and querying the results into a custom List, but I'm getting lost with this option, because it's still confusing for me on how to fill the widget report.

So, I would appreciate some advice or help in this issue.


Thanks in advance and regards.

J.M.

unread,
Mar 7, 2017, 5:38:17 AM3/7/17
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com
Hi again,

I've got to fill a report widget with data stored in an Oracle BD.
In order to getting it I have needed to create a CAPI with two activities:
In the first one, I take the report options (sortedColumns, queryFilters, etc.) for building a string with the appropiate SQL query, and in the second one I call a connector using SEC, for making the builded query to my Oracle database. I think the concept is right, however, I'm having some troubles with the report pagination.

I'll try to explain my problem:
Let's guess that my SQL query returns 104 results, for example. I've specified that the number of elements shown on each widget page is 20, so the first page I see in the report says "1-20 / 104" which seems to be correct, but if I click in the simple arrow at right to view next page, then the report says "21-40 / 84" instead of "21-40 / 104". I think this is because I've set the following:
var reportOptions = {
count:parseInt(P_computed.count),
first:P_first,
pagerCount: parseInt(P_computed.count)
};
where P_computed.count is the number of results returned from the CAPI.
Here are some examples of the SQL I'm building:
- SELECT * FROM (SELECT t.*, rownum r FROM J3_KEYED_REFERENCE t ) WHERE r > 0
- SELECT * FROM (SELECT t.*, rownum r FROM J3_KEYED_REFERENCE t WHERE KEY_NAME like '%uddi%' ORDER BY CATEGORY_BAG_ID desc) WHERE r > 0
- SELECT * FROM (SELECT t.*, rownum r FROM J3_KEYED_REFERENCE t WHERE KEY_NAME like '%uddi%' AND KEY_VALUE NOT like '%xml%' ORDER BY CATEGORY_BAG_ID desc) WHERE r > 20


Besides If I continue viewing next pages I see
"41-60 / 84",
"61-80 / 80" (please, note that, following the sequence it should be "61-80 / 64", which is nosense)

So I think there is an internal comprobation which checks if indexes have
crossed each other and then it stops the pagination and sets the total number to the highest number of the actual results.


So...
What I need is...
How can I paginate this widget?
How ca I get a report filled with Oracle data and having good pagination?

Thanks in advance and regards

Abhilash Sambhare

unread,
Apr 3, 2017, 2:50:14 AM4/3/17
to Fujitsu RunMyProcess Developer Community, javiermm...@gmail.com
Hi Javier,

Good Day.

Deepest Apology  for delay in response.

I have reproduce the same scenario on our side.You need to perform iteration on number of results getting in P_Computed from CAPI.

You can refer the following code for your reference:
var a = [];

function ok(P_computed) {
    for (i = P_first; i < P_computed.result.length; i++)
    {
        a.push({
            "name": P_computed.result[i].name,
            "email": P_computed.result[i].email
        });
        var options = {
            "filter": "Value",
            "name": "Ram",
            "operator": "CONTAINS",
            count: P_computed.result.length,
            first: P_first
        }
        id_report.setData(a, options);
        id_report.setLoading(false);
    }
}

function ko(P_error) {
    alert(JSON.stringify(P_error));
}
var input = {};
input.filter = "name";
input.value = "Ram";
input.operator = "CONTAINS";
var options = {};
id_capi__js_bind.trigger(input, options, ok, ko);
id_report.setVisible(true);
id_report.setLoading(true);

For more information regarding the Report pagination please go through the below link:

Hope this helps you.Don't hesitate to contact us for any query

Thanks & Regards,
Abhilash
Fujitsu Runmyprocess Support

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/73378858-492a-4c90-8158-8f973032f2af%40runmyprocess.com.

Reply all
Reply to author
Forward
0 new messages