KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Using Filter with a parameter #1136

Open Daniel Amamoo-Otchere opened this topic on on Oct 24, 2019 - 5 comments

Daniel Amamoo-Otchere commented on Oct 24, 2019

Hello Kool Team,

I have a dataset node which is used to build another dataset node2 with some filters. How do I apply a different paramter using the Filter option only for that dataset.


     $node ->pipe(new Filter([

Is the way I have defined the filter correct.

The records will come from another datasource not part of the main datasource found in $node

but part of the defaultParams value and bindParamsToInputs functions

KoolReport commented on Oct 24, 2019

it is just an array of ids for example

->pipe(new Filter([
Daniel Amamoo-Otchere commented on Oct 25, 2019

ok I mean can I use a variable like $id in replacement to the array [1,2,3,4,5]. this is because that is also coming from another parameter

KoolReport commented on Oct 25, 2019

Yes, if you have parameter in array form like $ids containing all ids you want to see, you replace with my [1,2,3,4,5] array. The MultiSelect widgets or Select2 multiple can output parameters in array form when your user select a list of ids, you may use them in the view.

Daniel Amamoo-Otchere commented on Oct 25, 2019

Still not so sure how to handle this :

Below is the select control. How do I pass it to the "dataStore"=>$this->dataStore("student_trend") below.

        <center><b>Performance per class child </b></center>
	          <h5>Select Level:</h5><?php
					    "title"=> 'Performance Charts',
						"width"=> '100%',
						"height"=> '100%',
						"legend"=>array("position"=> "right"),
						  "dataStore"=>$this->dataStore("student_trend")->FILTER("students_id","IN ",),
KoolReport commented on Oct 25, 2019

You should use the Select2, this allow multiple selection, the Select only allow single selection. So if you have a parameter "pStudent" that binds to your "pStudent" Select2 multiple. You will do this:

->pipe(new Filter([

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed