KoolReport's Forum

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

Add some interactivity to the report #776

Open Eugene opened this topic on on Apr 3, 2019 - 2 comments

Eugene commented on Apr 3, 2019

Hi,

as I said already many times, Koolreport is a fantastic tool for reporting - easy to use and powerful.

But now I would like to get a bit more :-)

How to add to a column's cells a text field or a checkbox and submit some data from them to a database?

KoolReport commented on Apr 3, 2019

You always can use the "formatValue" to return input html to show text box at the cell of a table. And if the cell is inside a form then it can post back its value to server. At server-side you may get those value through $_POST. You may update database with:

$this->src("mysql")->query("update mytable set field1 = :field1, field2=field2 where ...")
->params(array(
    ":field1"=>$_POST["field1"],
    ":field2"=>$_POST["field2"]
))->start();

The start() method basically will trigger the query execution.

Note: KoolReport is designed specifically for reporting purpose, meaning that it focus on pulling data not pushing it. So the effect of above code is out of our expectation and design. We have not tested and there could be error.

Eugene commented on Apr 4, 2019

Thanks, I will try.

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

None