开发者

report viewer web part in sharepoint (not the report viewer control) size issue

开发者 https://www.devze.com 2023-03-10 15:49 出处:网络
I am using SSRS in sharepoint integrated mode.When I view my report开发者_JS百科s using report viewer webpart, I often get scrollbars and it looks terrible.I couldn\'t find a solution for that other t

I am using SSRS in sharepoint integrated mode. When I view my report开发者_JS百科s using report viewer webpart, I often get scrollbars and it looks terrible. I couldn't find a solution for that other than sizing the report viewer webpart but as time goes on my report will grow and I do not want to do this again and again.

Any ideas how to autosize this..etc?

Thanks,


Add a Content editor webpart to the page and use the following jQuery-code:

<script type="text/javascript" src="http://yourSiteURl/_layouts/jquery-1.7.1.min.js"></script>
<script type="text/javascript">

function RapportIframeComplete() { 
if (RapportIframe[0].readyState != "complete") { 
    setTimeout("RapportIframeComplete();", 100); } 
else { 
    jQuery(RapportIframe[0]).attr('style','overflow:hidden;height:1750px;width:800px'); } 
}

jQuery(document).ready(function() {
RapportIframe = jQuery('iframe[id^=ReportFrame]');
RapportIframeComplete(); 
});

</script>

I uploaded jQuery to the layuots-folder of Sharepoint. Set the Reportviewer webpart to async rendering. The height and width in the code are set to a value that is big enough, so that nothing of my reports is hidden.


Is this problem browser-specific?

I know with the the Report Viewer control, I had to write some JavaScript to resize the control. Perhaps a similar approach would work here. You can load any scripts or style sheet files to the _layouts folder in the SharePoint site.


I had the same issue time ago. Maybe is too late but here is the solution:

<script language="JavaScript" type="text/JavaScript">
    window.onload =
    function setstart() {
        var els = document.getElementsByTagName('div');
        var i = els.length;
        while (i--)
            if (els[i].id.indexOf('uc') > 0) {
                els[i].style.overflowX = 'hidden';
                els[i].style.overflowY = 'hidden';
            }
    }
</script>

you must locate this script on the page head. In this example, the script hidde the scrollbars to all user controls called 'uc[SOMETHING]'.

0

精彩评论

暂无评论...
验证码 换一张
取 消