KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

CheckBoxList with manual data binding #77

Open bysystem opened this topic on on Aug 15, 2017 - 2 comments

bysystem commented on Aug 15, 2017

Dear support team,

I have created in my view an additional Checkbox with manual data and different text and values as follows:

Allgemein

"Sell", "data"=>array( "Out"=>"In", "Through"=>"Out", ), "display"=>"horizontal" )); ?>

Then in my setup I've added into my SQL statement the needed param as following:

$this->src('autorep') ->query("

SELECT Sell, Geschaeftsjahr, Monat, WerbegruppeVerbund, NikonKdName, NikonProdGruppe, Verkaufsmenge, Umsatz
FROM Reporting.autorep_v_noNulls
WHERE
	Sell IN (:Sell) AND
	WerbegruppeVerbund IN (:Werbegruppe) AND
	NikonProdGruppe IN (:NikonProdGruppe)
")->params(array(
		":Sell"=>$this->params["Sell"],
		":Werbegruppe"=>$this->params["Werbegruppe"],
		":NikonProdGruppe"=>$this->params["NikonProdGruppe"]

))

echo $this->params["Sell"];

In the WHERE condition I put Sell column with IN as it's an array, right? Also I added at the end my setup func an echo to see whether the Sell param will be passed or not. But unfortunately nothing happen, means: - no echo if I check neither only "In" nor "Out" nor both options. - If I click on "Submit" the preselection on one of the checkbox is lost!

Here is my frontend:

Any idea what could be the reason?

Kind regards

bysystem commented on Aug 15, 2017

Sorry, it was my fault! I forgot to add the new Checkbox field into defaulParamValues() and bindParamsToInput() as following:

function defaultParamValues()
{
    return array(
    "Sell" => array(),
        "Werbegruppe" => array(),
    "NikonProdGruppe" => array(),
    "ADBezirk" => array(),
    );
}

function bindParamsToInputs()
{
    return array(
    "Sell",
    "Werbegruppe",
    "NikonProdGruppe",
    "ADBezirk",
    );
}

Now it works!

KoolReport commented on Aug 16, 2017

Great!

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
solved

Pivot