Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Comments
bbirajdar 6-Jun-12 9:58am    
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 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....
bbirajdar 7-Jun-12 3:04am    
What is this stop watch method? Is it written in C# ?
Tony Tom.k 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;
bbirajdar 7-Jun-12 3:30am    
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.....

1 solution

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/[^]
 
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