KoolReport's Forum

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

Send Select2 values to PDF export #690

Closed Ahmed Bucheeri opened this topic on on Feb 19, 2019 - 4 comments

A
Ahmed Bucheeri commented on Feb 19, 2019

Hi

I have created parameter as follow

        Select2::create(array(
            "name"=>"SelectResource",
            "multiple"=>true,
            "dataStore"=>$this->dataStore("Resources"),
            "dataBind"=>array(
                "text"=>"ResourceName",
                "value"=>"ResourceId",
            ),
            "attributes"=>array(
                "class"=>"form-control",
            )
        ));

This is working good with view.php, now I want to sent the same to viewPDF.php using HTML post form

could you please help

K
KoolReport commented on Feb 19, 2019

You mean you want to post the selections to server and then server will export report with your selected conditions?

K
KoolReport commented on Feb 19, 2019

Please post your code inside code block

A
Ahmed Bucheeri commented on Feb 19, 2019

I have solved the problem by changing the code of form in qualityIndex.view.php as below

      <div class="text-center">
          <form method="post" action="export.php" target="_blank">
              <?php
                foreach ($this->params['SelectResource'] as  $value) {
              ?>
                <input type="hidden" value= <?php echo $value; ?>  name="SelectResource[]" />
              <?php
                }
              ?>
              <input type="hidden" value="<?php echo $this->params["startDatePicker"]; ?>" name="startDatePicker" />
              <input type="hidden" value="<?php echo $this->params["endDatePicker"]; ?>" name="endDatePicker" />
              <button class="btn btn-primary">Export to PDF</button>
          </form>
      </div>
    </div>
K
KoolReport commented on Feb 20, 2019

That's 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
None yet

None