Groupping Summary

QuestionsGroupping Summary
germanmary asked 3 years ago

Hi sir,

Hope you are doing well.

I need a help.

i would like to export the details with grouping total.

How to do it?

This is very urgent for to do it so i need your help?

Please Do the needfull for me

3 Answers
Abu Ghufran answered 3 years ago


This is currently not supported by grid, however you can do it using custom code using PDF based on html.
Refer demos/export/export-pdf-html.php

Gaëtan answered 3 years ago

Hi Abu,
I am trying to achieve the same.
Which code o we have to use to show the grouping summary ?

I am trying to show the value of the Total column:

$col = array();
$col["title"] = "Total";
$col["name"] = "total_cost";
$col["editable"] = false;
$col["width"] = "50";
$col["align"] = "center"; // this column is not editable
$col["search"] = false; // this column is not searchable
$col["summaryType"] = "sum"; // available grouping fx: sum, count, min, max, avg
$col["summaryTpl"] = '<b>GBP {0}</b>'; // display html for summary row – work when "groupSummary" is set true. search below
$cols[] = $col;

I am currently using your code to generate the PDF output:

function set_pdf_format($param)
$grid = $param["grid"];
$arr = $param["data"];

$html = <<<EOF
td.xbarcode {
font-family: 'barcode font';
font-size: 24pt;

$html .= "<h1>".$grid->options["export"]["heading"]."</h1>";
$html .= '<table border="0" cellpadding="4" cellspacing="2">';
$i = 0;
foreach($arr as $v)
$shade = ($i++ % 2) ? 'bgcolor="#efefef"' : '';
$html .= "<tr>";
foreach($v as $k=>$d)
// bold header
if ($i == 1)
$html .= "<td bgcolor="lightgrey"><strong>$d</strong></td>";
if ($k == 'client_id')
$html .= "<td class="barcode" $shade>$d</td>";
$html .= "<td $shade>$d</td>";
$html .= "</tr>";

$html .= "</table>";

return $html;

Can you help ?

Your Answer

11 + 18 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!