Jump to content
We've recently updated our Privacy Statement, available here ×

prabuddha.kulatunga

Members
  • Posts

    17
  • Joined

  • Last visited

Community Answers

  1. prabuddha.kulatunga's post in How to remove loading window from Jasper Server was marked as the answer   
    On loading.jsp file in the Jasper Server installation directory 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>[/code]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>[/code]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>[/code]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.
  2. prabuddha.kulatunga's post in How to reload a jasper report repeatedly within every one minute was marked as the answer   
    Found a way by myself.
    Go to ViewReport.jsp on jasper server installation files.
    Then add below code for it.(Actually we use java script to do this.)
     <script type="text/javascript">
         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 ){
            setTimeout(function(){
                window.location.reload(1);
            }, 5000);
         }
    </script>
    url is the current display report url.
    dash is the url that we want to refresh. otherwise all the reports will be refresh withn every 5seconds.
    5000 is time gap want to refresh.
    restart the jasper server.
    that's it..
     
×
×
  • Create New...