0
How to make Ireport send only one alert in case of no record found?
Currently, is with a
}else{
echo "Nenhum dado encontrado!!!";
so I get a page like this, I would like to get just an alert, not open a page, it is possible?:
Below the full code:
/* begin page handling*/
foreach ($this->arraydetail[$d] as $out) {
$this->currentrow=$this->arraysqltable[$this->global_pointer];
// echo $out["hidden_type"]."<br/>";
switch ($out["hidden_type"]) {
case "field":
// $txt=$this->analyse_expression($compare["txt"]);
// $out["txt"].":".print_r($out,true)."<br/>";
$maxheight=$this->detailallowtill-$checkpoint;//$this->arrayPageSetting["pageHeight"]-$this->arraypageFooter[0]["height"]-$this->pdf->GetY()+2-$this->columnheaderbandheight-$this->columnfooterbandheight;
$this->prepare_print_array=array("type"=>"MultiCell","width"=>$out["width"],"height"=>$out["height"],"txt"=>$out["txt"],
"border"=>$out["border"],"align"=>$out["align"],"fill"=>$out["fill"],"hidden_type"=>$out["hidden_type"],
"printWhenExpression"=>$out["printWhenExpression"],"soverflow"=>$out["soverflow"],"poverflow"=>$out["poverflow"],"link"=>$out["link"],
"pattern"=>$out["pattern"],"writeHTML"=>$out["writeHTML"],"isPrintRepeatedValues"=>$out["isPrintRepeatedValues"],"valign"=>$out["valign"],
"linktarget"=>$out['linktarget']);
$this->display($this->prepare_print_array,0,true,$maxheight);
// $checkpoint=$this->arraydetail[0]["y_axis"];
break;
case "relativebottomline":
//$this->relativebottomline($out,$tempY);
$this->relativebottomline($out,$biggestY);
break;
case "subreport":
$checkpoint=$this->display($out,$checkpoint);
//$this->arraydetail[0]["y_axis"]=$checkpoint;
//$biggestY=$checkpoint;
if($this->maxpagey['page_'.($this->pdf->getNumPages()-1)]<$checkpoint)
$this->maxpagey['page_'.($this->pdf->getNumPages()-1)]=$checkpoint;
break;
default:
//echo $out["hidden_type"]."=".print_r($out,true)."<br/><br/>";
$this->display($out,$checkpoint);
$maxheight=$this->detailallowtill-$checkpoint;
//$checkpoint=$this->pdf->GetY();
break;
}
if($this->pdf->getNumPages()>1){
$this->pdf->setPage($currentpage);
}
}
//$this->pdf->lastPage();
$checkpoint=$this->maxpagey['page_'.($this->pdf->getNumPages()-1)];
}//end loop detail band[]
$this->pdf->setPage($this->pdf->getNumPages());
$this->global_pointer++;
$rownum++;
$headerY=$checkpoint;
}
$this->global_pointer--;
}else {
echo "Nenhum dado encontrado!!!";
// return ("http://facebook.com/");
exit(0);
}
I don’t need to check if the field is empty, but the
echo
which put worked, the verification is done by the ireport itself, just needed the alert and return to the application, Thank you– Miguel Silva