I have this form
<?= Html::beginForm(
Url::toRoute("caja/imprimir"),
"get",
['class'=>'form-inline']
);
?>
<div class="form-group">
<table class="table table-bordered table-hover">
<thead>
<tr>
<td><strong>Fecha Inicial</strong></td>
<td> <?= DatePicker::widget(['name' => 'fechainicio', 'dateFormat' => 'yyyy-MM-dd']) ?></td>
</tr>
<tr>
<td> <strong>Fecha Final</strong></td>
<td> <?= DatePicker::widget(['name' => 'fechafin', 'dateFormat' => 'yyyy-MM-dd']) ?></td>
</tr>
<tr>
<td> <strong>Ruta</strong></td>
<td> <?= Html::dropDownList('id', null,
ArrayHelper::map(Rutas::find()->all(), 'id', 'nombre'), ['class' => 'form-control', 'prompt'=>'Selecionar...']) ?></td>
</tr>
</div>
</table>
<?= Html::submitInput("Generar", ['class' => 'btn btn-danger'])?>
<? Html::endForm()?>
Controller
$desde = date("Y-m-d", strtotime($_GET['fechainicio']));
$hasta = date("Y-m-d", strtotime($_GET["fechafin"]));
$ruta = Yii::$app->request->get("ruta");
$Ventas = Ventas::find()->andwhere(['>=','fecha',$desde])->andwhere(['<=','fecha' ,$hasta])->andwhere(['=','idruta',$ruta])->all();
$content = $this->renderPartial('_report', ['Ventas' => $Ventas]);
$pdf = new Pdf(['format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'content' => $content,
//'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',
'cssInline' => '.kv-heading-1{font-size:18px}',
'options' => ['title' => 'Krajee Report Title'],
'methods' => [
'SetFooter' => ['{PAGENO}']]]);
// return the pdf output as per the destination setting
return $pdf->render();
and print the pdf but it comes out blank.
I appreciate your helpmeā¦