Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi dear Friends...
 
In my ASP.Net C# Intranet Apllication I want to Generate some Excel files from...
Db.. I am generating Excel Files on generate butoon click But there I have to show some progress bar...
I got some samples but there is a fixed Time Out for Progress bar.. My Excel generation time Will vary according to the data User selected in each time...
So can any one suggest any tutorials or sample stuff which have multi threading in Asp.net C #
 
Thnks in advance
Posted 6-Jun-12 4:31am
Comments
   
You are saying that "the excel generation time will vary according to the options selected by the user "..Right ? So are you able to code the functionality that will calculate the time required for excel generation ?????? You need to complete this step first. Then in the second step you can create a progress bar which will display the remaining time left.. I will guide you for that..
Tony Tom.k at 7-Jun-12 2:56am
   
Heloo Boss...
Actually Here I am Using 2 forms In first form I will select all the Excel Generation Criterias and on button click I will Redirect into other page ..
There I am doing all Process...
 
Using Stopwatch method Now I am able to calcualte the excel generation execution time....
 
Tell me the second step....
   
What is this stop watch method? Is it written in C# ?
Tony Tom.k at 7-Jun-12 3:08am
   
Stopwatch sw = new Stopwatch();
sw.Start();
On my page Load I will start that stop watch and after Completion of my ExcelFile Generation I will stop the stopwatch
 

sw.Stop();
string ExecutionTimeTaken = string.Format("Minutes :{0}\nSeconds :{1}\n Mili seconds :{2}", sw.Elapsed.Minutes, sw.Elapsed.Seconds, sw.Elapsed.TotalMilliseconds);
 

 
I will get excecution time in minute seconds milliseconds format
 
We have to add this library refernce for getting stopwatch
using System.Diagnostics;
   
Ok.. Means you are able to calculate the excel generation time only AFTER the excel is generated. By the time the excel is generated, you cannot tell the user exactly how many seconds it will take to generate... So you should be able to calculate the excel generation time BEFORE it starts to generate. So that the user will see a progress bar with number of seconds decreasing, while the excel is being generated.....
Tony Tom.k at 7-Jun-12 3:39am
   
No I dont want to show him a dynamic progress bar(means % increasing) just user knows that Its generating Excel files, after that download popup comes I want to make hidden my progress bar,
 
I got some java scripts... On Button click, onclient click I will call the javascript it will show a progress bar.gif image....
 

There I will call one more Javascript there now i have given default time out for hiding that progress bar...
 
but I want to get the execution time from form 2 and pass that value to this form 1's javascript..
 
do you have any Idea hw to send back this value from my form2 form1
Tony Tom.k at 7-Jun-12 3:41am
   
Let me try with Request.QueryString

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

How long does it take to generate these files and are you generating one file at a click or multiple files?
 
Take a look here for a progress bar: http://csharptechies.blogspot.nl/2010/09/displaying-jquery-progressbar-with-ajax.html[^]
 
You can download the complete source from http://ajaxprogressbar.codeplex.com/SourceControl/list/changesets[^]
 
Is there a way to improve and optimise the generation process? In that case you can use an indicator instead. Take a look at this website to generate your own indicator: http://www.ajaxload.info/[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 5,130
1 DamithSL 4,237
2 Maciej Los 3,700
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,846


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 6 Jun 2012
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