KoolReport's Forum

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

PivotTable: How to hidden line || in dataFiled and make just Total in header to center ? #2573

Open yosimardianti opened this topic on on Feb 14, 2022 - 8 comments

yosimardianti commented on Feb 14, 2022

TOTAL use : 'totalName' => 'TOTAL',

and this is for header with ||

'measures'=>array(

'A',
'B', 
'C',

),

'dataField' => function($dataField, $fieldInfo) {

$x = $dataField;
if ($x == 'A'){
    $x = 'TITLE';
} else {
    $x = '';
}
return $x;

}

Thanks

Sebastian Morales commented on Feb 14, 2022

In the next version of Pivot package we will introduce an option in map property for you to change all the data field zone content instead of single field map. In the meantime you could use CSS rules to change the content like this:

<!-- MyReport.view.php -->
<style>
    .pivot-data-field-zone:after {
        content: "Hello world"; /* replace "Hello world" with your content */
    }
    .pivot-data-field-content {
        display: none;
    }
</style>  

Rgds,

yosimardianti commented on Feb 14, 2022

Thank you very much!

yosimardianti commented on Feb 14, 2022

and how make Total in center?

Sebastian Morales commented on Feb 14, 2022

Also use CSS. Right click the Total cell, choose Inspect element to see its class name and its parent element's class name:

<style>
    .pivot-column-header-total,
    .pivot-column-header-grand-total {
        text-align: center;
    }
</style>

Rgds,

yosimardianti commented on Feb 14, 2022

Thanks

yosimardianti commented on Feb 15, 2022

Hi Sebastian,

how to do that in export excel ?

yosimardianti commented on Feb 15, 2022

and how to hidden || if dataFiled like this ?

'dataField' => function($dataField, $fieldInfo) {

$x = $dataField;
if ($x == 'A'){
    $x = ' Title 1 ';
} else if ($v == 'B'){
    $x = 'Title 2 ';   
} else {
$x = '';
}
return $x;

}

Thanks,

Sebastian Morales commented on Feb 16, 2022

To map the whole data fields zone in excel export you would need both updated Pivot and Excel packages. If you don't want to wait for the next release pls send an email to support@koolreport.com / support@koolphp.net mentioning this topic. We will send you development versions of the packages. 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
solved

None