Hello, hoping someone can answer a question as I'm very new to javascript and even programming in general. Our company has a web api that is used in other reporting tools to figure out the number of business days between two dates. I am able to call this in a Pentaho Dashboard already, but I would like to use it in a report also but don't know how. Here's the function that is used in our Pentaho dashboard, normally in the post-fetch of some query object to manipulate the data...
function getBusinessDays(startDate, endDate) {
var startDateNew = startDate.replace(/\//g, ".");
var endDateNew = endDate.replace(/\//g, ".");
var result = 0;
var url = 'http://mycompany/api/totbusinessdays/' + startDateNew + '/' + endDateNew;
$.getJSON(url, function(data){
result = data[0].BusinessDays;
});
return result;
}
But now I would like to use this functionality in a Pentaho Report, but I have no idea how to do any type of custom coding in Report Designer. Any suggestions or advise? Is this even possible in Report Designer? Ideally users would enter the start and end dates for each report before running, and the business days would be used in a parameter-like fashion in various expressions. I hope this can be done as I would very much like to use Pentaho for both dashboards and reports, I'm just not very knowledgeable about how to get this working in a report though. Any help would be greatly appreciated!
function getBusinessDays(startDate, endDate) {
var startDateNew = startDate.replace(/\//g, ".");
var endDateNew = endDate.replace(/\//g, ".");
var result = 0;
var url = 'http://mycompany/api/totbusinessdays/' + startDateNew + '/' + endDateNew;
$.getJSON(url, function(data){
result = data[0].BusinessDays;
});
return result;
}
But now I would like to use this functionality in a Pentaho Report, but I have no idea how to do any type of custom coding in Report Designer. Any suggestions or advise? Is this even possible in Report Designer? Ideally users would enter the start and end dates for each report before running, and the business days would be used in a parameter-like fashion in various expressions. I hope this can be done as I would very much like to use Pentaho for both dashboards and reports, I'm just not very knowledgeable about how to get this working in a report though. Any help would be greatly appreciated!