Hidding toolbar for reports created using SSRS 2008 in CRM 2011

[亡魂溺海] 提交于 2019-12-10 11:28:29

问题


I have created report in SSRS 2008 and have attached them to the dashboard. The report is displaying fine, except for the fact that about 15-20 % of the space gets occupied by SSRS menu toolbar which has options for printing/zooming etc. Is there a way for me to minimize that tool bar? I also have a parameter bar that I can hide. But it doesn't stay hidden by default. Is there a way for me to temporarily hide the parameter bar when the dashboard loads? while googling i got this link but when i add that parameter to the report which is deployed i am getting CRM error. i am not very sure on the usage of the parameter which i am trying. i am very sure some sort of mistake i am doing. i am using the url in this way:

this is my url with parameter: http://xxx3:5555/CCPFINCRM/crmreports/viewer/viewer.aspx?action=filter&helpID=Test.rdl&id=%7bEFAB0D42-2165-E111-916B-90FBA631DAFB%7d&rc:Toolbar=false

The Error Message is as follows:


回答1:


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



来源:https://stackoverflow.com/questions/9597242/hidding-toolbar-for-reports-created-using-ssrs-2008-in-crm-2011

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