Generates an additional footer row below the subtotal band, and one additional footer above the grand total Default: The footerFn is defined as follows:
function MyFooterFn($group=false)
{
global $COL1, $COL2, $COL3;
echo "<tr><td>$COL1</td><td>$COL2</td><td>$COL3</td></tr>";
}
$lens->footerFn = 'MyFooterFn';
If the $group is false, then it is the footer just above the grand total band. If $group contains a real group, then it is displaying a footer for the final band.
Normally to gather the values (eg. sums and averages) to generate a footer, you need to use multiple powerLens that captures the required values for $COL1, $COL2, $COL3.
For example below, the last line is a generated footer:
| Branch | Staff | Sales | | East | | E1 | 4 | 2,000 | | E2 | 2 | 3,000 | | | 6 | 5,000 | | | Admin Staff 3 | Profit 2,400 |
Using the following function:
function FooterStaffSales($group=false)
{
global $DB;
$staff = $DB->GetOne("select staff from admintable where area=?",array($group));
$profit = $DB->GetOne("select profit from costing where area=?",array($group));
echo "<tr><td> </td><td>Admin Staff $staff </td><td>Profit $profit</td></tr>";
}
Basic:Yes Advanced/Enterprise:Yes DynamicEdit:Yes [Version 4.2.3]
|