jasperserver

How to remove loading window from Jasper Server


I want to remove the loading window, that appears when report loads/refresh. How to do this?

Can anyone tell me the file name in the jasper server installation directory that should I change at least?


Solution

  • On loading.jsp file in the Jasper Server installation directory(tomcat\webapps\jasperserver\WEB-INF\jsp\templates\loading.jsp) comment below part

    <t:insertTemplate template="/WEB-INF/jsp/templates/container.jsp">
        <t:putAttribute name="containerID" value="${not empty containerID ? containerID : 'loading'}"/>
        <t:putAttribute name="containerClass">panel dialog loading overlay moveable centered_horz centered_vert ${containerClass}</t:putAttribute>
        <t:putAttribute name="containerTitle"><spring:message code='jsp.wait'/></t:putAttribute>
        <t:putAttribute name="headerClass" value="mover"/>
        <t:putAttribute name="bodyContent" >
        
        <p class="message" role="alert" aria-live="assertive"><spring:message code='jsp.loading'/></p>
        <button id="cancel" class="button action up"><span class="wrap"><spring:message code="button.cancel"/></span><span class="icon"></span></button>
        
        </t:putAttribute>   
    </t:insertTemplate>
    

    When you do like above example, loading window will be disappear from everywhere.

    To remove loading for a specific report,

    put two div tags with id attribute. then hide the div using js code.

    Below I shown the example;

    <div id="prabu">
        <div id="x3">
            <t:insertTemplate template="/WEB-INF/jsp/templates/container.jsp">
                <t:putAttribute name="containerID" value="${not empty containerID ? containerID : 'loading'}"/>
                <t:putAttribute name="containerClass">panel dialog loading overlay moveable centered_horz centered_vert ${containerClass}</t:putAttribute>
                <t:putAttribute name="containerTitle"><spring:message code='jsp.wait'/></t:putAttribute>
                <t:putAttribute name="headerClass" value="mover"/>
                <t:putAttribute name="bodyContent" >
        
                    <p class="message" role="alert" aria-live="assertive"><spring:message code='jsp.loading'/></p>
                    <button id="cancel" class="button action up"><span class="wrap"><spring:message code="button.cancel"/></span><span class="icon"></span></button>
        
                </t:putAttribute>   
            </t:insertTemplate> 
        </div>
    </div>
    

    Then add below javascript code;

    <script>
        var url = window.location.href; //take current tab url
        var dash = 'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Original__2_&standAlone=true';
    
        if(url === dash ){
            removeElement("x3");
    
        }
    
        function removeElement(elementId) {
        // Removes an element from the document
            var element = document.getElementById(elementId);
            element.parentNode.removeChild(element);
        }
    </script>
    

    In my case, I use a report as my dashboard and I refresh it in every 1 minute.So I want to remove loading window for my dashboard report only.

    On js code, url is current url from the browser. dash is the my dashboard report url.