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
Hello,
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
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
<!– EXAMPLE OF CSS STYLE –>
<style>
td.xbarcode {
font-family: 'barcode font';
font-size: 24pt;
}
</style>
EOF;
$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>";
else
{
if ($k == 'client_id')
$html .= "<td class="barcode" $shade>$d</td>";
else
$html .= "<td $shade>$d</td>";
}
}
$html .= "</tr>";
}
$html .= "</table>";
return $html;
}
Can you help ?
Thanks