KoolReport's Forum

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

Excel : cannot apply style on pivot table export #757

Open ABLM Europea Services opened this topic on on Mar 21, 2019 - 3 comments

ABLM Europea Services commented on Mar 21, 2019

Hi, I'm currently trying to apply some style on a pivot table excel export, it exports well but without style.

Im I doing it wrong ? Does pivot supports custom style ? I would like to change columns color and have bold headers. I actually spent the whole day on it. I have koolreport pro.

Here's my PivotTable's array datasource :

and my template TablePivot.excel.php

<div sheet-name="<?php echo "Non-conformités"; ?>">
	<div cell="A1" range="A1:H1">
        <?php echo "Export non conformite"; ?>
    </div>
	<div>
        <?php
PivotTable::create(array(
            "dataSource" => 'values',
            "columnsExcelStyle" => [
                'transporteur' => [
                    'font' => [
                        'italic' => true,
                        'size' => 30,
                        'color' => [
                            'rgb' => '818580'
                        ]
                    ],
                    'fill' => [
                        'fillType' => 'darkGray'
                    ]
                ],
                'indicateur' => [
                    'font' => [
                        'italic' => true,
                        'size' => 30,
                        'color' => [
                            'rgb' => '801280'
                        ]
                    ],
                    'fill' => [
                        'fillType' => 'darkGray'
                    ]
                ]
            ]
            // enleve l'header des lignes
            'headerMap' => array(
                $this->settings['countvalue'] . ' - count' => ''
            )
        ));
        ?>
    </div>
</div>

Thank you in advance for your interest and have a nice day

David Winterburn commented on Mar 22, 2019

Hi there,

So far excel template export has only supported "columnsExcelStyle" for the Table widget due to somewhat different structure between a table (static column structure) and a pivot table (dynamic column structure).

We will soon explore ways to add style to pivot table widget in excel template. Please contact us in 2 or 3 weeks for update on this issue. Thanks!

Kerry commented on Jan 26, 2021

Any update on adding styles to the pivot table? We frequently use the pivot table to show data but manually changing the format is time consuming if we do it and frowned upon if we require the end users to perform this task.

Thanks

David Winterburn commented on Jan 27, 2021

Hi Kerry,

Please check the excel style documentation of excel's PivotTable widget when exporting to excel:

https://www.koolreport.com/docs/excel/excel_widgets/#pivottable-widget-(version-%3E=-6.0.0)-excelstyle

Please test it and let us know if you have any 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

Excel