KoolReport's Forum

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

Table server side paging with filters and excel download #1026

Open vamsi.p@autozilla.co opened this topic on on Aug 1, 2019 - 7 comments

vamsi.p@autozilla.co commented on Aug 1, 2019

I am generating sales order report with multiple filters like date rage and filter by customer brand could you please help us

David Winterburn commented on Aug 1, 2019

Hi Vamsi,

Would you please be more specific about your report? For general purpose you could look at the code of our multiple examples:

https://www.koolreport.com/examples/

Thanks!

vamsi.p@autozilla.co commented on Aug 1, 2019

Hi David,

I have large data set when using Table::create() it gives performance issue, so i want to use data tables with bind parameters, date range input and excel export. In given examples For table example there is no server side pagination option and for data tables no bind parameters and export options. Is there any such example please provide.

And also when loading kool report on boot strap ajax modal, charts and table pagination not displaying. I Found that koolreport scripts are not loading in modal pop.

Please help us.

Thanks!

vamsi.p@autozilla.co commented on Aug 2, 2019

Dates not appear after loading how can i solve this.

David Winterburn commented on Aug 6, 2019

Hi Vamsi,

  1. With DataTables widget's server-side processing, you could pass parameters via its "scope" property and the argument $scope in dataSource's function:
            DataTables::create(array(
                    'name' => 'salesTable',
                    'dataSource' => function($scope) {
                        return $this->src('pdoMysql')
                        ->query('select * from customer_product_dollarsales2')
                        ->params([
                            'param1' => $scope['param1']
                        ])
                        ->pipe(new Map($this->lowerCase))
                        ;
                    },
                    'scope' => $paramsToPass,
                    ...
  1. We will find our own solution for exporting to excel a page in DataTables' server-side processing. For now, please try this solution: https://datatables.net/extensions/buttons/examples/initialisation/export.html

  2. A KoolReport page requires javascript initialization in KoolReport.js. Please describe in detail how you load reports in your modal pop? Thanks!

vamsi.p@autozilla.co commented on Aug 6, 2019

Thank you David.

I am calling kool report in modal as below

<a href="http://localhost/vendor/reports" data-remote="false" data-toggle="modal" data-target="#myReportModal" class="btn btn-default"> Sale Report </a>

$("#myReportModal").on("show.bs.modal", function(e) {

var link = $(e.relatedTarget);
$(this).find(".modal-body").load(link.attr("href"));

});

URL: http://localhost/vendor/reports contain code

<?php

    require APPPATH."/reports/MyReport.php";

				$report = new MyReport;
				$report->run()->render();

?>

When modal appears the server content loaded in modal along with following scripts <script type='text/javascript' src='http://localhost/vendor/assets/3170239207/KoolReport.js'></script><script type='text/javascript'>KoolReport.load.resources({"js":["http:\/\/localhost\/vendor\/assets\/127977741\/jquery.min.js",["http:\/\/localhost\/vendor\/assets\/2479016726\/js\/bootstrap.min.js"]],"css":["http:\/\/localhost\/vendor\/assets\/2479016726\/css\/bootstrap.min.css","http:\/\/localhost\/vendor\/assets\/2479016726\/css\/bootstrap-theme.min.css"]});</script><style>

The above scripts are not applying to document.

Tech Apps commented on Mar 29, 2021

KoolReport Team,

when the solution for this issue will be provided.

Sebastian Morales commented on Mar 29, 2021

Pls state which specific issue you meant? Tks,

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