Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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.
 
Regards
Ashok
Posted 26-Dec-10 23:01pm
Comments
Richard MacCutchan at 27-Dec-10 6:26am
   
See my update below.
Rate this: bad
good
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.
 
Example:
 
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
}
  Permalink  
v2
Rate this: bad
good
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.
  Permalink  
Comments
gamini891 at 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 at 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.

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

  Print Answers RSS
0 OriginalGriff 534
1 Gihan Liyanage 298
2 RyanDev 270
3 Sergey Alexandrovich Kryukov 223
4 Richard Deeming 185
0 Sergey Alexandrovich Kryukov 8,906
1 OriginalGriff 7,771
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 27 Dec 2010
Copyright © CodeProject, 1999-2014
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