Click here to Skip to main content
13,055,408 members (54,012 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All,

I need progress bar along with percentage calculation parallelly while downloading & writing the records to Excel sheet.

Based on the inut parameters, the query will triggered and fetch the information from database, that resultant data will be write into Excel sheet. That file will be maintained at file system.

So above process will take some time, based on time needs to calcualte the percentage to visualise the progress bar along with percentage, how much downloaded and how much needs to download.

As per my assumptions that process speed will consider on following factors Like:
1) Depends on server performance & End user cpu utilisation
2) No. of records availability at database level
3) Query optimisation
4) Required data size. etc...

I read so many article, all of are
Progress bar growthis in incremental way that is statically, this implementation never consider above points.
So finally I need live percentage, progress bar.

Posted 26-Dec-10 23:01pm
Richard MacCutchan 27-Dec-10 6:26am
See my update below.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

As I understand your question, the issue here is not the progress bar but the calculation of the percentage values. That is something only you can do based on the information you are able to collect within your program.
gamini891 27-Dec-10 6:02am
Absolutely, I will agree. But based on the information only..Ok.. how could we calculate the percentage?? At the same time, at runtime how many records are available & how much content we are going to extract.. we don't know.. That will decide at runtime.. So we can't assign/assume a timeline to download each record.
Richard MacCutchan 27-Dec-10 6:25am
Well, you have to get all the information at runtime and calculate based on that: number of records, time to process each record etc. If the information is not available to you then you cannot calculate anything. As I said before this is a question of obtaining the information and making calculations based on what you want to do.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

In this situation, please don't use Continuous or Blocks style, use Marquee style of ProgressBar.


public void LoadData(){
   progressBar.Style = ProgressBarStyle.Marquee;
   progressBar.Visible = true;//Show progress bar
   //Code to load data into Control
   progressBar.Visible = false;//Hide progress bar

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 27 Dec 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100