I have managed that as under JRResultSetDataSource jrSource = new JRResultSetDataSource(rs); // rs is ResultSet JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,map, jrSource); // filling the report if(jasperPrint.getPages().isEmpty()) // getPages() method returs List containing pages.. List is empty //when there is no page JOptionPane.showMessageDialog(null,"No Page to display"); else JasperViewer.viewReport(jasperPrint,false);