Well, I have a page with links to reports. Whenever somebody clicks on one report, they can download the excel file. However, sometimes there are no fields to make a report;
echo "";
Try out this way it works...
First assign the window with the new page where the alert box must be displayed then show the alert box.