Show alert if no records found - Ireport

0

How do I get Ireport to send only one alert in case of no records found?

You currently have one

}else{

echo "Nenhum dado encontrado!!!";

So I get a page like this, would like to receive only one alert, not open a page, is it possible ?:

Belowthefullcode:

/*beginpagehandling*/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);

        }
    
asked by anonymous 24.04.2018 / 16:00

2 answers

1

Miguel believes it to be so

    if(empty($nome1) or empty($nome2)){

  echo "<script>alert('Nenhum campo pode fica vazio.');top.location.href='index.php' ;</script>";

}

source

    
24.04.2018 / 23:41
0

I do not think it's that simple, but what comes to mind when you ask this is a simple

alert ('No data found !!!');

No? If it is not (I doubt it is, honestly), can you better explain what you want to do?

    
24.04.2018 / 23:19