Hello community!!. I use pdf export with "render_type" = html. Here is my code:
…
$grid["export"] = array("format"=>"pdf", "filename"=>"pedidos", "heading"=>"Pedidos", "orientation"=>"landscape", "paper"=>"a4");
$grid["export"]["render_type"] = "html";
$grid["export"]["range"] = "filtered";
…
$e["on_render_pdf"] = array("set_pdf_format", null);
…
// Esta funciĆ³n de callback permite actuar al capturar el evento "on_render_pdf".
function set_pdf_format($param)
{
$grid = $param["grid"];
$arr = $param["data"];
$pdf = $param["pdf"];
$pdf->SetFont('helvetica', 'B', 11);
$html .= "<h1>".$grid->options["export"]["heading"]."</h1>";
$html .= '<table border="0" cellpadding="4" cellspacing="2">';
$i = 0;
$j=0;
foreach($arr as $v)
{
$shade = ($i++ % 2) ? 'bgcolor="#efefef"' : '';
$html .= "<tr>";
foreach($v as $d)
{
if ($i == 1)
switch ($j)
{
case 0:
$html .= "<td width="50" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 1:
$html .= "<td width="130" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 2:
$html .= "<td width="150" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 3:
$html .= "<td width="80" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 4:
$html .= "<td width="75" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 6:
$html .= "<td width="90" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 7:
$html .= "<td width="70" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
case 11:
$html .= "<td width="70" bgcolor="lightgrey"><strong>$d</strong></td>";
break;
default:
$html .= "<td width="60" bgcolor="lightgrey"><strong>$d</strong></td>";
}
else
$html .= "<td $shade>$d</td>";
$j = $j+1;
};
$html .= "</tr>";
};
$html .= "</table>";
return $html;
};
Does someone know why this line "$pdf->SetFont('helvetica', 'B', 11);" doesn't work?.
Thanks!!.
In fact, when i use $grid["export"]["render_type"] = "html"; none sentence of the PDF format customization API works.