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 6025803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:21:11+00:00 2026-05-23T04:21:11+00:00

I have created a project with a simple RDLC report in ASP.NET which when

  • 0

I have created a project with a simple RDLC report in ASP.NET which when I bind the DataSource of the report at design time using a SqlDataSource everything works just fine. But if I remove the binding and try to set the DataSource from code then the report seems to never stop loading.

I’ve worked with this on WinForms apps in the past and had no problems, but this is the first time I’ve tried to do it in ASP.NET, with no luck.

Here’s the code I’m using to set the DataSource in the Page_Load event. As I said using the same SqlDataSource that works if it’s bound in the .aspx page.

ReportViewer1.Reset()
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report.rdlc")
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", SqlDataSource1))
ReportViewer1.LocalReport.Refresh()

Even if I set the report directly in the reportviewer control and chop the code down to just…

ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", SqlDataSource1))
ReportViewer1.LocalReport.Refresh()

…it still does the same.

Also, in Visual Studio while the report is loading you can see that a huge amount of script blocks are constantly being generated (the listbox keeps growing):

Visual Studio

While this is going on the loading spinner is just going round halfway, restarting and repeating. The page isn’t reloading though.

Any thoughts?

  • 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-05-23T04:21:12+00:00Added an answer on May 23, 2026 at 4:21 am

    OK, as usual not long after you post a question, you find a solution.

    The solution to this was to make sure the setting of the DataSource is only performed when the page is not a postback. SO in short wrap the code block in:

    If Not Page.IsPostBack Then
    
        <set datasource here>
    
    End If
    

    I guess this is because of the AJAX nature of the reportviewer? If anyone could shed any light on why this is the case I’d be interested to hear it.

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

Sidebar

Related Questions

I have created a a subclass of Table in my ASP.NET project which creates.
i have created a simple public ref class in the vc++ project, which is
I have created a setup project using Visual Studio 2008. After the application is
I have created a setup project in VS2008. My WinForms app uses .NET 2.0,
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a simple project where everyone can create one or more Blog.
I have created windows service project in vs2008. I have created simple serivce project
I have created a small flash CS4 project that has a few custom components
In order to improve my open source project, I need testers. I have created
I have a setup project created by Visual Studio 2005, and consists of both

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.