Forum

This content is now out of date.

Visit Our Community

Incomplete Filters with Javascript API

Hello,

I want to use the javascript API to display a report in another application. The report has 3 filters of which 2 are required. All filters are properly set by the yellowfin.reports.loadReportFilters but it still shows the error 'Incomplete filters' and the report is not started to run. Whan manually pressing the 'go/run' icon it runs fine with the parameters already populated by the API. I wil include the code afterwards. My question is how I can get the report to run to show content without user interference?
Thanks in advance!
Best regards,
Kai Asmussen

### Code start




function myFunction() {

function filterCallback(filters) {

var filterValues = {};

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

if (filters[i].description == 'Ledger') {

filterValues[filters[i].filterUUID] = 'Vision Belgium';

} else if (filters[i].description == 'VAT Declaration Type') {

filterValues[filters[i].filterUUID] = 'BE10673976';

} else if (filters[i].description == 'Period Year transaction') {

filterValues[filters[i].filterUUID] = 2007;

}
}
var options = {};
options.reportUUID = "4d93e524-acd8-4c69-a8e0-ce4ebd4ec25c";
options.elementId = "reportContainer2";
options.token = '4ab5f2bb670855e7f76be1032302f569';
options.filters = filterValues;
yellowfin.loadReport(options);
}

yellowfin.reports.loadReportFilters(
"4d93e524-acd8-4c69-a8e0-ce4ebd4ec25c", filterCallback);


}
myFunction();


### Code end
Hi Kai,

Thanks for sending in the question. I did some testing using your code in Yellowfin 7.2 and I was successfully able to pass filter values via the JS API using the Ski Team tutorial database. Here is an example of the code I used:

[code]






function myFunction() {

function filterCallback(filters) {

var filterValues = {};

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

if (filters[i].description == 'Year (Dim)') {
filterValues[filters[i].filterUUID] = '2013';
}

}
var options = {};
options.reportUUID = "486d19ee-7976-450e-93cd-f475ae486fa0";

options.elementId = "myreport";

options.filters = filterValues;
yellowfin.loadReport(options);
}

yellowfin.reports.loadReportFilters(
"486d19ee-7976-450e-93cd-f475ae486fa0", filterCallback);
}
myFunction();

[/code]

So I'm wondering a couple of things.

1. Which version/build of Yellowfin are you using. What version and build of Yellowfin are you using? To check the build of Yellowfin you are using go to System Information under Administration > Admin Console > System Information. The build information is listed next to Application Version.

2. Is there anything special about your filters? You said that two of your filters are required, does this mean that they are configured as mandatory filters?

If you would like, you can email this information to us at support@yellowfin.bi. This will log a case in our CRM and will allow us to route your query to other parties if necessary.

Anyway, I look forward to hearing back and hopefully we can get to the bottom of this quickly.

Kind Regards,

Dustin

Best regards,

The Yellowfin Support Team

Contact Us:
Email: support@yellowfin.bi�
Wiki: wiki.yellowfin.com.au/display/USER71/Home
Community Forum: www.yellowfinbi.com/YFForum.i4
/Applications/Test/Yellowfin 7.1 20150729/appserver/webapps/ROOT/WEB-INF/web-jsps.xml