At the moment i’m using a seperate button on my page to display the content of my (filtered) gridview on that page in a pdf document, when i click it the pdf shows in the current page and displays fine, but I would like it if the pdf showed in a new page/tab in my browser and i can’t get it to work… Any1 here who could help me?
Controller code:
public function actionIndex()
{
$this->pageTitle = "Leerlingregistratie - Aanwezigheden";
$model=new VLnnAanw('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['VLnnAanw']))
$model->attributes=$_GET['VLnnAanw'];
if (isset($_GET['btnPdf']))
{
$dataProvider= $model->search();
$dataProvider->pagination= false; // for retrive all modules
$data = $dataProvider->getData();
// MAKE PDF
...
foreach ($data as $model){
...
}
$pdf->Output('overview.pdf', 'I');
}
$this->render('lijstPersoneel',array(
'model'=>$model,
));
}