Click here to Skip to main content
15,747,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

Richard MacCutchan 27-Dec-10 6:26am    
See my update below.

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.
Share this answer
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.
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
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900