Home » Microsoft TechnologiesRSS

How I disable vertical scroll bar of report viewer control on Web Form.

I'm displaying .rdlc report file using Report viewer control on Webform. If  I Fix height of viewer control and data is not same as to size of viewer control then it display one scrollbar on viewer control and second vertical scroll bar is coming on webpage.

 I want to off viewer vertical scrollbar or in simple word's I don't want to display two scroll bar with my report. Please guide me or send me reference if any.

Thanks,

 

14 Answers Found

 

Answer 1

You to set two properties to make the repoertviewer autosize:

AsyncRendering = false;

and

SizeToReportContent = true;

 

Answer 2

By the way that solution doesn't work :(

 

Answer 3

Here's what I did to remove the vertical  scrollbar.

Set the webpart height  to 800px (or whatever suits your needs).
Locate the Div ID that wraps around the web  part (example: #ctl00_ctl10_g_002108f3_8e9e_47f6_aa29_dce37c6009)
In a stylesheet like master.css add this line at the bottom:

#ctl00_ctl10_g_002108f3_8e9e_47f6_aa29_dce37c6009 {
 overflow: hidden !important;
}

 

Answer 4

AsyncRendering = false; and SizeToReportContent = true; it is working fine but navigation feature is not working

bye

narasimha

 

Answer 5

Even I had the same problem.. Angry

by doing the following stuff works here,

AsynRendering="true",Width="100%",Height="Whatever u want", ** style="margin-bottom:30px(in mine case)"

Hope it help u too ...Smile

 

Answer 6

This made the trick for me, great and simple  idea!

thanks !


rmandal:

Even I had the same problem.. Angry

by doing the following stuff works here,

AsynRendering="true",Width="100%",Height="Whatever u want", ** style="margin-bottom:30px(in mine case)"

Hope it help u too ...Smile


 

Answer 7

pabloah:

This made the trick for me, great and simple  idea!

thanks !


rmandal:

Even I had the same problem.. Angry

by doing the following stuff works here,

AsynRendering="true",Width="100%",Height="Whatever u want", ** style="margin-bottom:30px(in mine case)"

Hope it help u too ...Smile


 

 

Once you use a complex report  you'll realize it doesn't solve the issue.

 

It's a bug in Microsoft's horribly ugly control. It's really surprising that MS out something like that. 

 

We contacted support and they told us it's bug and there isn't any plan of fixing it as of now.

 

Nick

 

Answer 8

greenerist:

Here's what I did to remove the vertical  scrollbar.

Set the webpart height  to 800px (or whatever suits your needs).
Locate the Div ID that wraps around the web  part (example: #ctl00_ctl10_g_002108f3_8e9e_47f6_aa29_dce37c6009)
In a stylesheet like master.css add this line at the bottom:

#ctl00_ctl10_g_002108f3_8e9e_47f6_aa29_dce37c6009 {
 overflow: hidden !important;
}

 

I needed a similar but different solution. report  viewer in an aspx page with just one hyperlink above the RV had 

Width="100%"Height="100%"AsyncRendering="false"SizeToReportContent="true"

 but the report data  almost always had scrollbars in addition to the browser's.  Using F12 in IE8 I found the div with overflow:auto causing the problem with an ID like P04d35da423884a1e8480cc04e7080509oReportDiv but the guid part changed so I added

<scriptlanguage="JavaScript"type="text/JavaScript">

 window.onload=

function setstart(){

 var els = document.getElementsByTagName('div');

var i = els.length;

while ( i-- )

if( els[i].id.indexOf('ReportDiv') > 0 )

els[i].style.overflow = 'visible';

}

 </script>

and FINALLY it looks right.

 

 

 

Answer 9

http://tech-days.blogspot.com/2009/11/sql-server-report-viewer-autosize.html

 

Answer 10

Hi,

Adjust the report  borders means try to avoid the blank space between your design envirronment and report borders. If you are not properly adjust these borders it may take more space for report while rendering, because of this you will get scroll  bars in the report. 

 

Answer 11

Solution 1:- Hide the scroll  bar by the below command.

 

window.onload =

function setstart() {

 

    var els = document.getElementsByTagName('div');

    var i = els.length;

    while (i--)

        if (els[i].id.indexOf('ReportDiv') > 0)

        els[i].style.overflowY = 'hidden';

 

}

 

<rsweb:ReportViewer ID="ReportViewer1"   Width="100%" runat="server">

</rsweb:ReportViewer>

 

Set the below properties of the ReportViewer

ReportViewer1.Visible = true;

ReportViewer1.AsyncRendering = false;

ReportViewer1.ShowCredentialPrompts = false;

ReportViewer1.SizeToReportContent = true;

 

 

Solution 2 :- Add the below code on the bottom of the page after the </form> tag

<script type="text/javascript">

 

    var els = document.getElementsByTagName('div');

    var i = els.length;

    parent.document.getElementById('ifName').style.height = (screen.height - 378) + "px";

    while (i--)

        if (els[i].id.indexOf('ReportDiv') > 0) {

        els[i].style.height = '448';

        els[i].style.overflow = 'scroll';

    }

 

</script>

 

The above code is for the screen resolution 1280/1024.

For making the above the code working for different resolution we can change the height accordingly for the ReportViewer.

<rsweb:ReportViewer ID="ReportViewer1"   Width="100%" runat="server">

</rsweb:ReportViewer>

 

Set the below properties of the ReportViewer

ReportViewer1.Visible = true;

ReportViewer1.AsyncRendering = false;

ReportViewer1.ShowCredentialPrompts = false;

ReportViewer1.SizeToReportContent = true;

 

Answer 12

have never used SharePoint services, but if you can edit the HTML, go to the IFRAME tag:

<iframe src="Sample.aspx" ... ...>...</iframe>

and add the attribute SCROLLING="no".

<iframe scrolling="no" src="Sample.aspx" ... ...>...</iframe> 

 

Answer 13

    <script src="JS/jquery-1.4.2.min.js" type="text/javascript">
    </script>

    <rsweb:ReportViewer ID="reportViewer" runat="server" Width="100%" AsyncRendering="False" SizeToReportContent="True">
    </rsweb:ReportViewer>

    <script type="text/javascript" language="javascript">
        $(document).ready(function() {
            var reportDiv = $("div[id$='oReportDiv']").css("overflow-y", "visible")[0];
            if (reportDiv != null) {
                reportDiv.style.height = reportDiv.scrollHeight + 15 + "px";
            }

        });
    </script>

 

Answer 14

Unfortunately, asyncrender=false does not render an image with internal padding correctly.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter