pdm91
(Pramodmahale92)
1
Hii guys,
I was trying to generate paramaterised report using
IReport Extension
When i try to pass parameters from controller action to report.jrxml it generates blank pdf report.
Here is the action is used to pass parameters:
public function actionClientwise()
{
$model=new Mstclient;
if(!empty($_POST['Mstclient']['ClientID']))
{
// echo $_POST['Mstclient']['ClientID'];
Yii::import('application.ext.extensions.ireport.*');
$config=dirname(__FILE__).'/reports/ClientReport_IDWise.jrxml';
$AReport = new IReport($config);
$AReport->parameters = array("Client_ID"=>1);
$AReport->execute();
}
$this->render('report',array(
'model'=>$model,
));
}
Client_ID is the parameter.
Hi,
Its doing write thing… this is what u have done… you have initialized code but u have not filled the values…
[size=2]
[/size]
[size=2]This line is just new object initialisation[/size]
$model=new Mstclient;
you should fill something inside . you have not done
THAT IS THE REASON FOR NO DATA
May be u missed the below line
$mode->attribute = $_POST[‘Mstclient’];
[size=2]
[/size]
public function actionClientwise()
{
$model=new Mstclient;
if(!empty($_POST['Mstclient']['ClientID']))
{
// echo $_POST['Mstclient']['ClientID'];
Yii::import('application.ext.extensions.ireport.*');
$config=dirname(__FILE__).'/reports/ClientReport_IDWise.jrxml';
$AReport = new IReport($config);
$AReport->parameters = array("Client_ID"=>1);
$AReport->execute();
}
$this->render('report',array(
'model'=>$model,
));
}
Client_ID is the parameter.
[/quote]
pdm91
(Pramodmahale92)
3
sorry for the late reply…
I have added the above line but still it generates empty pdf.
is it because I am trying this on my localhost…
I need to reactivate this post, because I have the same problem, when executing, the page remains in target, you do not show result.
I have in my controller:
public function actionReportes()
{
$model=new TblResultados;
if(!empty($_POST['TblResultados']['idnom']))
{
Yii::import('application.ext.extensions.ireport.*');
$repo=dirname(__FILE__).'/Reportes/Nomina_por_Resultados.jrxml';
error_reporting(0);
$AReport = new IReport($repo);
$AReport->parameters = array("idnom"=>1);
$AReport->execute();
}
}
Thanks & Regards,
Rafael