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

Subscribe to our news:
Partners
Testimonials
Dave Lantz: "I have to say that I simple love this product and its ease of use. I know that I have only tapped into about 20% of what it can do. In my business I come into a lot of contact with developers and I tell them all, that if they need an easy way to connect, report or work their databases they MUST check out your products".
Tony Broadbent: "Such a great product! I have been struggling to hand craft pages which, with your PHP Generator, I created beautifully within 5 minutes of downloading it".

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