javascripthtmloracle-apexoracle-apex-5

Hide and show Report region when no data found


I'm using APEX 5 page to show a classic report region, I want to hide this region when no data found. I used javascript code in Page HTML Header but it's not working:

    <script type="text/javascript">
            var has_rows = document.getElementById('news_region').rows;
            if (has_rows==0){
        $("news_region").hide();
        } 
</script>

Solution

  • Well, a simple option is to use region's "Server-side condition" whose type is "Rows returned", while the SQL query is just the same as report region's query.

    It works OK, no doubt in that, but I don't know it'll behave when the query is heavy (returns a lot of rows, selects from huge tables and stuff). Though, I presume it won't cost much to try it.