【问题标题】:How to remove loading window from Jasper Server如何从 Jasper 服务器中删除加载窗口
【发布时间】:2021-04-08 00:18:01
【问题描述】:

我想删除在报告加载/刷新时出现的加载窗口。 如何做到这一点?

谁能告诉我jasper服务器安装目录中的文件名我至少应该更改吗?

【问题讨论】:

    标签: jasperserver


    【解决方案1】:

    关于 Jasper Server 安装目录中的 loading.jsp 文件(tomcat\webapps\jasperserver\WEB-INF\jsp\templates\loading.jsp) 在下方评论

    <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 标签放入 id 属性。然后用js代码隐藏div。

    下面我展示了示例;

    <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>
    

    然后在下面添加javascript代码;

    <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>
    

    就我而言,我使用报表作为仪表板,每 1 分钟刷新一次。所以我只想删除仪表板报表的加载窗口。

    在 js 代码上, url 是浏览器的当前 url。 dash 是我的仪表板报告网址。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-24
      • 2018-04-23
      相关资源
      最近更新 更多