KoolReport's Forum

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

ExcelExport reordering my columns #788

Open JYassine opened this topic on on Apr 8, 2019 - 3 comments

JYassine commented on Apr 8, 2019

Hi !

I actually want to swap some of my columns in my datastore that is used by ExcelExport. I tried #329 but it did not work !

Thanks.

David Winterburn commented on Apr 9, 2019

Hi,

Please try the columns option like in this code example:

    $report->exportToExcel(array(
        'dataStores' => array(
            'salesQuarterCustomer' => array(
                'columns' => array('customerName', 'customerNumber', 'Total'),
            )
        )
    ))
    ->toBrowser("SalesQuarters.xlsx");

Let us know if it works for you or not. Thanks!

JYassine commented on Apr 9, 2019

Hi,

Thank you for replying this fast, but the output is actually the same, i got 2 calculated columns that are added at the end of my Excel even if i specify the columns order in the exportToExcel.

David Winterburn commented on Apr 11, 2019

Hi,

Please send us an email to support@koolphp.net regarding this topic. We will send you a development version of the Excel package to address this exported column order problem. Thanks!

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

Export