Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,
I am generating pdf which will get stored in a path mention how can i use background worker to accomplished the task. Its Winforms c#
Posted
Comments
Manfred Rudolf Bihy 10-Aug-12 6:47am    
Which parts are you having difficulties with? Using a Backgroundworker is very straightforward, so there must be some detail, that would explain what is giving you trouble, missing from your question.
Please edit your question and add the interesting bits.

Regards,

Manfred
rohit24c 10-Aug-12 6:59am    
I have a save()
{
// i am writing logic to save the pdf here...
}
Button_click()
{
save();
}
Now ot take time to save all pdfs in a path by that time i can allow the user to use other AREAS of my application.
rohit24c 10-Aug-12 7:00am    
its like i have 2 buttons to genarate pdf and generate excel both can be done ??
[no name] 10-Aug-12 7:06am    
Read the documentation for the backgroundworker class.

1 solution

In a sample on MSDN you can learn how a BackgroundWorker operates: How to: Run an Operation in the Background[^]. The DoWork and RunWorkerCompleted event handlers you'll hook up to the backgroundworker will do the brunt of the work. You'll have to make sure though that the processing and/or save method is encapsulated in a class you should define. That way you won't pollute your code and everything is neatly separated. It will also make it easier for you to track the progress of the processing and saving in the front end, especially when there is more than one process going on at any one time.

Regards,

Manfred
 
Share this answer
 
Comments
Wendelius 10-Aug-12 16:04pm    
:thumbsup:

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