KoolReport's Forum

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

The way how to export as excel with my view file paramaters #504

Open Eo Yoonmin opened this topic on on Oct 30, 2018 - 2 comments

Eo Yoonmin commented on Oct 30, 2018

I have added Koolreport Input Packages like DateTimePicker and Select2 in my view file. When i export to excel with Koolreport Excel Packages, how can i pass parameters to export to excel. I looked up the Example, but I could not find it. Show me an example. thx~

Eo Yoonmin commented on Oct 30, 2018

I have solved this by referring to topic #129.

  • codeigniter controller : saleslist.php public function toexcel() {
    $report = new Rsaleslist;
    $report->run()->exportToExcel(array(
      "dataStores" => array(
        'result'
      )
    ))->toBrowser("report.xlsx");
    

    }

adding the download button set the formaction like this:

  • rsaleslist.view.php <button class="btn btn-success" formaction="/saleslist/toexcel">EXCEL DOWNLOAD</button>

Thank you~~

David Winterburn commented on Oct 30, 2018

Hi Yoonmin,

Thank you for your feedback! Yes, yours is a correct way to submit a report together with its input parameters for exporting (Excel, PDF, CSV, etc). The report's form's action is itselft to submit for viewing so to submit for exporting we could set the attribute "formaction" of the Export button to your export page.

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
solved

Excel