Hidding toolbar for reports created using SSRS 2008 in CRM 2011

最后都变了- 提交于 2019-12-06 09:06:46

My solution involves several steps, mostly unsupported - but it works.

  1. Clone the existing C:\Program Files\Microsoft Dynamics CRM\CRMWeb\CRMReports\viewer\viewer.aspx to .\viewerNoToolbar.aspx

  2. Update in viewerNoToolbar.aspx the following code to remove the Toolbar from SSRS :-

    function reportLoaded()
    {
    
    if (oFrame.readyState === "complete")
    {
        addToRecent();
    }
    

    to

    function reportLoaded()
    {
    
    if (oFrame.readyState === "complete")
    {
        addToRecent();
        var frameDoc = oFrame.contentDocument || oFrame.contentWindow.document; 
        var reportViewerToolbar = frameDoc.getElementById("reportViewer_Toolbar");
        reportViewerToolbar.style.display = "none";
    }
    
  3. Insert a DIV to hide the existing CRM toolbar and move the existing resultFrame IFrame out of the DIV

    </div>
    <table cellspacing="0" cellpadding="0" width="100%" height="100%">
    

    to

    </div>
    <div style="display: none">
        <table cellspacing="0" cellpadding="0" width="100%" height="100%">
    

    also close it off by changing the below from

         </table>
     </body>
    

    to (and remove the existing td block related to resultFrame)

            </table>
        </div>
        <table cellspacing="0" cellpadding="0" width="100%" height="100%">
            <tr style="height: 100%;">
                <td colspan="2" style="padding-top: 5px; padding-bottom: 10px; border-width: 2px;
                    border-color: #000000">
                    <div id="divResultFrame">
                        <iframe name="resultFrame" id="resultFrame" src="/_static/blank.htm" style="border: 0px;
                            margin: 0px; padding: 0px; width: 100%; height: 100%;"></iframe>
                    </div>
                </td>
            </tr>
        </table>
    </body>
    
  4. Change your query to

    http://xxx3:5555/CCPFINCRM/crmreports/viewer/viewerNoToolBar.aspx? 
    

    and don't worry about rc:Toolbar

Good luck Glenn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!