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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:39:22+00:00 2026-05-11T01:39:22+00:00

I have a ProgressBar that uses the marquee style when a report is being

  • 0

I have a ProgressBar that uses the marquee style when a report is being generated. The reason I am doing this is because the ReportViewer control I use takes some time to generate the report thus making the form unresponsive. I generate the report using a thread so the ProgressBar can show that the program is working. However, when I start the thread the ProgressBar freezes. I have already tried the BackgroundWorker but that didn’t work so I used my own threading.

The reason I use the Invoke() method is because I can’t make changes to the ReportViewer control on the thread I created because it was created on the UI thread.

The method that takes the most time processing is the RefreshReport() method of the ReportViewer control which is why I’m trying to do that on its own thread instead of the UI thread.

Any help would be appreciated. Thanks.

Here is the code for my thread variable:

Private t As New Thread(New ParameterizedThreadStart(AddressOf GenerateReport)) 

Here is the code for the button that generates the report:

Private Sub btnGenerateReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerateReport.Click     pbReports.Style = ProgressBarStyle.Marquee      If t.ThreadState = ThreadState.Unstarted Then         t.IsBackground = True         t.Start(ReportType.Roads)     ElseIf t.ThreadState = ThreadState.Stopped Then         t = Nothing         t = New Thread(New ParameterizedThreadStart(AddressOf GenerateReport))         t.IsBackground = True         t.Start(ReportType.Roads)     End If End Sub 

Here is the code that generates the report:

Public Sub GenerateReport(ByVal rt As ReportType)     If rvReport.InvokeRequired Then         Dim d As New GenerateReportCallBack(AddressOf GenerateReport)         Me.Invoke(d, New Object() {rt})     Else         rvReport.ProcessingMode = ProcessingMode.Remote         rvReport.ShowParameterPrompts = False         rvReport.ServerReport.ReportServerUrl = New Uri('My_Report_Server_URL')         rvReport.ServerReport.ReportPath = 'My_Report_Path'         rvReport.BackColor = Color.White          rvReport.RefreshReport()     End If      If pbReports.InvokeRequired Then         Dim d As New StopProgressBarCallBack(AddressOf StopProgressBar)         Me.Invoke(d)     Else         StopProgressBar()     End If End Sub 
  • 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. 2026-05-11T01:39:22+00:00Added an answer on May 11, 2026 at 1:39 am

    Your code is starting a new thread from the UI thread. The new thread then immediately marshals back to the UI thread using Invoke – so basically it’s as if you hadn’t made it multithreaded at all.

    Instead of that, make the new thread do all the background processing it can and only marshal back to the UI for parts of the process that need to update the UI.

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

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Re wait or change now? Personally, I'd wait (see Do… May 11, 2026 at 2:56 pm
  • added an answer The YUI Compressor is fantastic. It works on JavaScript and… May 11, 2026 at 2:56 pm
  • added an answer Assuming there's no easier way to do this, implement the… May 11, 2026 at 2:56 pm

Related Questions

When copying large files using shutil.copy() , you get no indication of how the
I am trying to capture output from an install script (that uses scp) and
Resolution: While trying to recreate this bug in a fresh project to submit to
I understand that the Windows API uses classes, relying to the WNDCLASS / WNDCLASSEX

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.