What is the correct way to pass an array to .params?

0

I'm trying to make a more generic page for serving reports, but I'm running into an issue when trying to pass parameters. Being as that it's a generic page, I can't hard-code the parameters, so I was trying to set something up where I just load the default parameters, create input controls, and, whenever one of the controls changes, push the values of those controls into an array that I can reload the report with. Sounds simple, right? I had everything working except for that last part.

I got frustrated and deleted the code, but the following should give an example of what I was trying to do:

$("#startdate").change(function(){
startdatestring = $("#startdate").val() + 'T00:00:00';
 
var param =[];
param.push('"B1_APPL_STATUS_DATE_1":['+startdatestring+']');
param.push('"B1_APPL_STATUS_DATE_2":['+enddatestring+']');
report.params({param}).run();
});
 
This causes the report to reload without errors, but it is still using the default parameters (ones defined in the ad hoc itself). Any help?
alexanderdav's picture
Joined: Apr 4 2016 - 8:27am
Last seen: 2 years 4 months ago

1 Answer:

0

Keep in mind that all paramaters passed through Visualize.js start out in an array.

Here is a fiddle showing the proper way to pass paramaters with multiple values. If they can't be hard coded you can pull them in dynamically using variables.

dpetzold's picture
Joined: May 12 2014 - 10:47am
Last seen: 1 year 8 months ago
Feedback