Inside a report you can see the total records number
$("table[qbdbid=[tableId]] tr:first").text();
[tableId] => should be your table id , remove the square brackets
once you get the string , you can search for the string "no results". if the string consist of "no results" make a if loop and give as an alert there are no records.
I Think this will solve your problem.