Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to 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 10-Aug-12 1:42am
Comments
Manfred R. Bihy at 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 at 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 at 10-Aug-12 7:00am
   
its like i have 2 buttons to genarate pdf and generate excel both can be done ??
Wes Aday at 10-Aug-12 7:06am
   
Read the documentation for the backgroundworker class.

1 solution

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

Solution 1

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
  Permalink  
Comments
Mika Wendelius at 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)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 10 Aug 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