Groupping Summary

QuestionsGroupping Summary
germanmary asked 4 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 4 years ago

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

Gaƫtan answered 4 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
<!– 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

Your Answer

1 + 18 =

Login with your Social Id:

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?