0
votes

I am using CDE to create a Pentaho Dashboard. But I need to present the data in many ways where no component is useful. So I would like to use the Free Form Component to paint the data myself.

How do I access my data from the Free Form Component? For example, I'd like to loop the resultset, and for each row, write the data in some custom way.

But I don't know how to access the data from the query I defined in the Datasource. I tried:

function (dataset) {

for (var i=0; i < dataset.resultset.length; i++) {

Like I saw in some post-fetch example, but it didn't work.

I am finding almost 0 info on how to code anything CDE. Is there no API anywhere? Thanks for any help I can get.

2

2 Answers

1
votes

Either post-fetch or post execution should do. When you say it didn't work, what happened ? Errors in the javascript console ? Are you sure the data is getting to the component ?

Lots of resources for CDE can be found in the pentaho forums at http://forums.pentaho.com/forumdisplay.php?80-Community-Tools-CTools.

0
votes

I believe the freeform component doesn't run the query unless you explicitly tell it to.

One way around it, without having to code the doQuery method of the freeform component, is using a query component that fetches the data and in the postFetch fireChanges a parameter that the freeform component listens to.

Then you can refer to the data on the queryComponent by looking into render_<queryComponentName>.queryState.lastResults().