Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8395867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:24:19+00:00 2026-06-09T20:24:19+00:00

In VS10 is there a way to keep SizeToReportContent=true and force a vertical scrollbar?

  • 0

In VS10 is there a way to keep SizeToReportContent=true and force a vertical scrollbar? I have a DDL that allows the user to pick a report, which sets the DataSource for a ReportViewer. SizeToReportContent seems to be the only way to dynamically control the width of the report to align with the width of the ReportViewer. The page contains a display area with a height smaller than the reports. If the ReportViewer had a vertical scrollbar then the report would meet the display area constraints.

I have tried all kinds of combinations of style formatting and size changes to the .rdlc with no luck of forcing a scrollbar while SizeToReportContent=true.

Both the width and height properties of the ReportViewer are overridden, but from which property of the .rdlc?

The report is being processed locally, but I do not think that makes a difference.

TIA!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:24:20+00:00Added an answer on June 9, 2026 at 8:24 pm

    I hope this helps someone…

    Brute forcing the ReportViewer to generate required page dimensions.

    Set SizeToReport=false. Appended desired width of each report to the name of the .rdlc value separated by a “|”. In the run report method split the selected value to get the .rdlc name and its width. This means physically determining the width of each report to be hard coded with the report name – [weak!].

    code:

    ddl in report .ascx [actually populated from the db, but I wanted to show data]

    <asp:DropDownList ID="reportDropDownList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RunReport">
        <asp:ListItem Selected="True" Value="0">-- Select Report --</asp:ListItem>
        <asp:ListItem Value="RVSum.rdlc|504" >RV Purchased Sum</asp:ListItem>
        <asp:ListItem Value="ZeroPricePurchasesView.rdlc|550">Zero Price Purchases</asp:ListItem>
        ...
    </asp:DropDownList>
    

    run report method:

    protected void RunReport(object sender, EventArgs e)
    {
        ObjectDataSource source = new ObjectDataSource("WC.DataAccess.DAO.ReportsDAO", "GetAllReports");
        string path = "RDLC" + "\\";
        string ddlValue = "";
    
    
        if (reportDropDownList.SelectedIndex != 0)
        {
            ddlValue = reportDropDownList.SelectedValue.ToString();
            string[] ddlSplit = ddlValue.Split('|');  //split ddl selected value
            path = path + ddlSplit[0];  //.rdlc name
            reportViewer.LocalReport.DataSources.Clear();
            reportViewer.LocalReport.ReportPath = path;
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", source));
    
            reportViewer.AsyncRendering = false;
            reportViewer.SizeToReportContent = false;
            reportViewer.ShowZoomControl = false;
            reportViewer.Height = 400;  // default value but exactly what is needed
    
            reportViewer.Width = Convert.ToInt32(ddlSplit[1]);  // desired report width
            reportViewer.DataBind();
    
        }
        else  /* default clear viewer */
        {
            reportDropDownList.SelectedIndex = 0;
            reportViewer.LocalReport.DataSources.Clear();
            reportViewer.Reset();
        }
    }
    

    I do not like this type of programming, but until MS provides a better report viewer this will do.

    I am still interested in some suggestions – moving on for now…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way in VS10 to set the F5 key, so VS always
I'm working from VS10 and have a master page that loads jQuery via: <script
I'm using VS10 and C# and I've encountered a weird problem. I have 2
I have made a new Excel 2010 Add-in project, with VS10. When I run
I have a C# VS10 project. I want its part to be pure C.
I have a build script (.bat) that invokes MSBUILD ( C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ) that used
There is a REG_MULTI_SZ value that I would like to stick in an array
In the STL implementation of VS10 there is the following code for a variant
I have been working with VS10 for years and yesterday I have installed VS12
I have been having some problems with the test debugger in VS10. All tests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.