Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Charles Phillips: "Just want to take a second to really thank you for all the great support you give – I think that’s by far the best feature you offer".
George Westrup: "I have saved so much time using your products. Also you are quick to respond to every question I have had. Thanks for the great support".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnCustomRenderTotals

This event occurs before total values rendering and allows you to replace the default total footer content. To use it, enable the grid footer in the View properties of the corresponding column.

 

 

Signature:

function OnCustomRenderTotals ($totalValue, $aggregate, $columnName,

    &$customText, &$handled)

 

Parameters:

$totalValue

The value of currently processed total.

$aggregate

The string representation of total aggregate ('AVG', 'SUM', 'MIN', 'MAX', 'COUNT').

$columnName

The column name of currently processed total.

$customText

A string to replace the total cell content.

$handled

A parameter to indicate whether the event handler executed. Set $handled to true in the event handler to apply new content.

 

Example 1:

The code below changes the caption of the 'amount' column footer and gives it strong importance.

 

if ($columnName == 'amount')

{

    $customText = '<strong>Total: $' . $totalValue . '</strong>';

    $handled = true;   

}

 

This picture demonstrates the difference between a webpage generated with default footer and a webpage with the OnCuStomRenderTotals event specified in this way:

 

 

Example 2:

The code below is used in our online demo on the 'Teams' page to display the year of foundation of the oldest team on the page in more convenient form.

 

if ($columnName == 'year_founded') {

   $customText = 'MIN: ' . intval(str_replace(',', '', $totalValue));

   $handled = true;

}

 



Prev Return to chapter overview Next