KoolReport's Forum

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

Rename TOTAL to GRAND TOTAL #336

Open V Vijaykumarr opened this topic on on Jun 25, 2018 - 5 comments

V Vijaykumarr commented on Jun 25, 2018

Hello,

I want to rename the Total to Grand Total in Pivot table.

I tried the headerMap, but it didnt work.

'headerMap' => array(
              'Total' => 'Grand Total <span class="grand_title">T.PROD | NO</span>',
)

David Winterburn commented on Jun 26, 2018

Hi Vijay,

Please use the following option to change the Total text:

'totalName' => 'Grand Total <span class="grand_title">T.PROD | NO</span>',

Thanks!

V Vijaykumarr commented on Jul 4, 2018

Hello,

The above method didn't work, Can you please suggest another working way?

Thanks.

David Winterburn commented on Jul 4, 2018

Hi, could you please post your php code here for us to check it. Thanks!

V Vijaykumarr commented on Jul 4, 2018
PivotTable::create(array(
            "dataStore"=>$dataStore,
            "rowDimension"=>"row",
            "columnDimension"=>"column",
            "measures"=>array(
              "prod_tot - sum",
              'prod_tot - count',
            ),
            'rowSort' => array(
              'prod_tot - count' => 'desc',
            ),
            'columnSort' => array(
              'created_month' => function($a, $b) {
                return (int)$a < (int)$b;
              },
            ),
            'rowCollapseLevels' => array(2), // 2
            'columnCollapseLevels' => array(0), // 1
            'width' => '100%',
            'headerMap' => array(
              'prod_tot - sum' => '<span id="header_name">Name<span>',
              'prod_tot - count' => '<span id="header_salesperson_name">Salesperson</span> | <span id="header_rookie_date">Rookie Join Date (<1 Year)<span>',
              '1' => 'January',
              '2' => 'February',
              '3' => 'March',
              '4' => 'April',
              '5' => 'May',
              '6' => 'June',
              '7' => 'July',
              '8' => 'August',
              '9' => 'September',
              '10' => 'October',
              '11' => 'November',
              '12' => 'December',
              'January' => 'January <span class="sub_title">T.PROD | NO</span>',
              'February' => 'February <span class="sub_title">T.PROD | NO</span>',
              'March' => 'March <span class="sub_title">T.PROD | NO</span>',
              'April' => 'April <span class="sub_title">T.PROD | NO</span>',
              'May' => 'May <span class="sub_title">T.PROD | NO</span>',
              'June' => 'June <span class="sub_title">T.PROD | NO</span>',
              'July' => 'July <span class="sub_title">T.PROD | NO</span>',
              'August' => 'August <span class="sub_title">T.PROD | NO</span>',
              'September' => 'September <span class="sub_title">T.PROD | NO</span>',
              'October' => 'October <span class="sub_title">T.PROD | NO</span>',
              'November' => 'November <span class="sub_title">T.PROD | NO</span>',
              'December' => 'December <span class="sub_title">T.PROD | NO</span>',
            ),
          ));
David Winterburn commented on Jul 6, 2018

Hi Vijay,

I didn't see a TotalName property in your PivotTable widget's setup, please add it like this:

    PivotTable::create(array(
            "dataStore"=>$dataStore,
            'totalName' => 'Grand Total <span class="grand_title">T.PROD | NO</span>',
            ...

Let us know if it works for you or not. 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

Pivot