KoolReport's Forum

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

DataTables - Buttons Plugin CSV export- only downloads first page #2748

Open James Schlies opened this topic on on Jul 4, 2022 - 2 comments

James Schlies commented on Jul 4, 2022

When using the following, I get the CSV button as expected but it only download the first page of data. Is this expected behavior??? This report is very large can have up to 200,000 recs. Also, any tips on tuning this are welcome.

DataTables::create(

    [
        'name' => 'PBHBDetail',
        'dataSource' => function () {
            return $this->src('PBHBDetail')
                ->query($this->params['query_sql']);
        },
        'scope' => $this->params,
        "plugins" => ["Buttons"],
        "options" => [
            "searching" => false,
            "paging" => true,
            "pagingType" => "input",
            "colReorder" => true,
            "order" => [],
            "ordering" => false,
            "pageLength" => 50,
            "bInfo" => false, // remove 'showing x to y of z entries'
            "dom" => 'Bfrtip',
            "buttons" => [
                "copy", "colvis", "csv"
            ]
        ],
        "columns" => \UCSF\DOM\Reports\DivisionRpt\PBHBDetail::determine_columns(),
        "showFooter" => false,
        "serverSide" => true,
        "searchOnEnter" => true,
        "searchMode" => "or",
        "cssClass" => [
            "table" => "table table-striped table-bordered compact",
        ],
    ]);
Sebastian Morales commented on Jul 5, 2022

DataTables' Buttons plugin is is client-side solution. Thus, it's not relevant to export huge datasets. Pls try our Excel package for server-side export of excel and csv files.

James Schlies commented on Jul 5, 2022

Thanks, that my next stop.

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