Hidding toolbar for reports created using SSRS 200

2019-05-25 18:27发布

问题:

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