jasperUser12 Posted September 26, 2014 Share Posted September 26, 2014 Hi,I can call reports with parameterised input controls from jasperserver in my php without any problems but what I can't figure out how to do is implement cascading input controls properly.For example, say I have I/P Control A with values of A1, A2 and I/P Control B with values of A1b1 and A1b2 if I/P Control A has A1 selected or values of A2b1 and A2b2 if I/P Control A has A2 selected. I cannot get this to replicate in the php api. I/P Control A will generate with A1 and A2 and I/P Control B will generate with A1b1 and A1b2 (ie the A1 values) but I can't force it to reload to A2b1 and A2b2 if A2 is selected. Has anyone figured this out? I've looked at the Input Control JSON structure and there is a field called "slaveDependencies" but I can't figure out how to take advantage of that. How can I call an input control to regenerate based on the value of its master control?Thanks in advance! Link to comment Share on other sites More sharing options...
jasperUser12 Posted October 6, 2014 Author Share Posted October 6, 2014 I got it working but I had to write a new function in the wrapper.public function setCascadingInputControls($uri, $controls, $payload) { // $controls is masters;active;slaves/ $url = $this->restUrl2 . '/reports' . $uri . '/inputControls/' . $controls . '/values'; $data = $this->service->prepAndSend($url, array(200), 'POST', $payload, true, 'application/json', 'application/json'); // Can use the InputControl createFromJSON() function as structure is the same. //print($data); return InputControl::createFromJSON($data); }[/code]The $controls object has to be defined as follows : "masterDependencies;currentControlSelected;slaveDependencies"The $payload object has to be an array of objects with the key as the control id and the value as (a possible array of) the selected option(s). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now