KoolReport's Forum

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

Echoing MultiSelect option values #153

Open bysystem opened this topic on on Nov 10, 2017 - 4 comments

bysystem commented on Nov 10, 2017

Dear support team,

according to the example InputAndExport-PDF (under https://github.com/koolphp/koolreport/blob/master/examples/reports/advanced/input_and_export/InputAndExport_pdf.view.php) I can echo the value of a SINGLE SELECT OPTION field (like customer name) without any problem:

//Single Select Option field $customerName = $this->params["customer"]; echo "<br/>".$customerName."<br/>";

But if my dynamic filter filed a MULTI SELECT OPTION field I get only the output "Array" in the PDF document instead of, for example, multiple selected cities!

//MultipleSelect Option field $city= $this->params["customerCity"]; echo "<br/>".$city."<br/>";

How can I echo the values of these multiple select options?

Kind regards,

KoolReport commented on Nov 10, 2017

You need to use the for loop to loop through the array and echo each value

bysystem commented on Nov 10, 2017

Could you please give me a short example?

KoolReport commented on Nov 10, 2017

Oh, it is simple:

foreach($this->params["customerCity"] as $city)
{
    echo $city;
}
bysystem commented on Nov 10, 2017

Thx a lot! Really simple! It works fine!

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

None