KoolReport's Forum

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

Export with Input package (Select2 - Multiple = TRUE) #936

Open benoit opened this topic on on Jun 19, 2019 - 6 comments

benoit commented on Jun 19, 2019

Hi, Koolreport team,

I need to export a report.

Actually I use the following line to post the value of a Select2 ("multiple"=>FALSE,)

<input type="hidden" value="<?php echo $this->params["date"]; ?>" name="date" />

But now I need to post the values of a Select2 ("multiple"=>TRUE,)

How do I proceed?

KoolReport commented on Jun 19, 2019

you can do:

<?php
foreach($this->params["multiple_date_select"] as $item)
{
?>
    <input type="hidden" value="<?php echo $item ?>" name="multiple_date_select[]" />
<?php
}
?>
benoit commented on Jun 19, 2019

It works!! Thank you

KoolReport commented on Jun 19, 2019

You are welcome :)

benoit commented on Jun 19, 2019

Sorry for my questions. I'am not an IT specialist. I'm just an accountant.

I have one more problem. If I have several input fields in my report do I have like this ?

<?php
foreach($this->params["date"] as $item1)
foreach($this->params["rec"] as $item2)
	{
?>
		<input type="hidden" value="<?php echo $item1 ?>" name="date[]" />
		<input type="hidden" value="<?php echo $item2 ?>" name="rec[]" />
<?php
	}
?>

If I do like this and the field rec is empty it doesn't work.

KoolReport commented on Jun 19, 2019

No problem, you do this:

<?php
foreach($this->params["multiple_date_select"] as $item)
{
?>
    <input type="hidden" value="<?php echo $item ?>" name="multiple_date_select[]" />
<?php
}
?>


<?php
foreach($this->params["rec"] as $item)
{
?>
    <input type="hidden" value="<?php echo $item ?>" name="rec[]" />
<?php
}
?>
benoit commented on Jun 19, 2019

Yeah!!!

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
None yet

Export