KoolReport's Forum

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

Pivot table column header #2264

Open Oya Kaynar opened this topic on on Aug 16, 2021 - 3 comments

Oya Kaynar commented on Aug 16, 2021

Column headers in pivot table not showing properly. How can you help with this?

code example;

 ->pipe(new Pivot(array(
            "dimensions" => array(
                "column" => "",
                "row" => array("PLAN_YEAR", "PLAN_MONTH", "RENT_INVOICE_DATE","KIRA","DETAY_RENT_SDATE","DETAY_RENT_EDATE","KIRA2")
            ),




  "showDataHeaders" => true,
//                "rowDimension" => "row",
                "columnDimension" => "column",
//              'hideTotalRow' => true,
               'hideTotalColumn' => true,
                'hideSubtotalRow' => true,
               'hideSubtotalColumn' => true,
 'measures'=>array(
                    'PLAN_YEAR'=>'Yıl',
                    'PLAN_MONTH'=>'Ay',
                    'RENT_INVOICE_DATE'=>'Fatura Tarihi',
                    'KIRA - sum'=>'Fatura Tutarı',
                    'DETAY_RENT_SDATE'=>'Dönem Başlangıç',
                    'DETAY_RENT_EDATE'=>'Dönem Bitiş',
                    'KIRA2'=>'Fatura Tutarı Detay',
                ), //görünmesi istenen alanlar

'headerMap' => array(
                    'PLAN_YEAR'=>'Yıl',
                    'PLAN_MONTH'=>'Ay',
                    'RENT_INVOICE_DATE'=>'Fatura Tarihi',
                    'KIRA - sum'=>'Fatura Tutarı',
                    'DETAY_RENT_SDATE'=>'Dönem Başlangıç',
                    'DETAY_RENT_EDATE'=>'Dönem Bitiş',
                    'KIRA2'=>'Fatura Tutarı Detay',
                ),
Sebastian Morales commented on Aug 17, 2021

In your setup you don't have any column fields in your Pivot ("column" => "") and then in your widget you also hide the total column ('hideTotalColumn' => true, 'hideSubtotalRow' => true,). I would suggest turn on the total columns in your PivotTable/PivotMatrix widget:

    PivotTable::create(array(
        ...
        'hideTotalColumn' => false,
        'hideSubtotalRow' => false,
Oya Kaynar commented on Aug 25, 2021

The values I set for the column appear. But the column name that I want to specify manually is not visible in view and Excel.view. When I define a custom function to place the headers, they all come together. It is not separated on a column-by-column basis. It keeps colspan=7 in the class. I request your support in this matter. Example code;

 'map' => array(
                    'dataField' => function($dataField, $fieldInfo) {
                        if ($dataField === 'PLAN_YEAR')
                            return 'y....';
                        if ($dataField === 'PLAN_MONTH')
                            return 'A....';
                        if ($dataField === 'RENT_INVOICE_DATE')
                            return 'F......';
                        if ($dataField === 'KIRA - sum')
                            return 'F......';
                        if ($dataField === 'DETAY_RENT_SDATE')
                            return 'D......';
                        if ($dataField === 'DETAY_RENT_EDATE')
                            return 'D.......';
                        if ($dataField === 'KIRA2')
                            return '.........Detay';

                        return '';
                    },
                ),
Sebastian Morales commented on Aug 26, 2021

Pls post your Pivot process, your PivotTable/PivotMatrix create and screenshots of the problem. 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
None yet

None