Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
QuestionReports every Monday at 7am. Pin
Jacob Dixon25-May-09 6:38
Jacob Dixon25-May-09 6:38 
AnswerRe: Reports every Monday at 7am. Pin
dan!sh 25-May-09 7:17
professional dan!sh 25-May-09 7:17 
GeneralRe: Reports every Monday at 7am. Pin
Jacob Dixon25-May-09 7:30
Jacob Dixon25-May-09 7:30 
GeneralRe: Reports every Monday at 7am. Pin
Luc Pattyn25-May-09 7:37
sitebuilderLuc Pattyn25-May-09 7:37 
GeneralRe: Reports every Monday at 7am. Pin
Le centriste28-May-09 8:33
Le centriste28-May-09 8:33 
GeneralRe: Reports every Monday at 7am. Pin
Jacob Dixon25-May-09 15:20
Jacob Dixon25-May-09 15:20 
AnswerRe: Reports every Monday at 7am. Pin
Le centriste25-May-09 7:18
Le centriste25-May-09 7:18 
AnswerRe: Reports every Monday at 7am. Pin
_Maxxx_25-May-09 12:27
professional_Maxxx_25-May-09 12:27 
Firstly - I'd set up some method by which each report can be scheduled to be run and/or sent at a different time (because that's bound to be a requirement in the future!)

Get your collection of scheduled times and convert them to 'next run Date Times' sorted in ascending order. Remember you will need some way of telling when a report was last run, too, so that a report scheduled for 7:00 does not also get run at 7:01)

Calculate teh time from NOW to the first entry in your list. Set a timer for this duration (less a short amount to cater for discrepancies.

Decide whether you will allow new reports to be added into the current schedule between NOW and the next scheduled report time, or reports to be removed from the schedule. (if you do, you need some polling to detect a change, and restart the algorithm .

On 'waking' re-build the collection (in case something has changed). If the next scheduled report is due (or past due) run it, and update it's 'Last Run' date/time then re-create the collection (catch multiple reports scheduled simultaneously).

You need to decide (assuming you implement the polling mentioned above) how time critical you need it to be. If +- 5 minutes is going to be OK - then your polling can be once every five minutes (remembering that your polling should probably be paused while any report is in progress)

Hint for young players; When I had somethinglike this implemented a few years ago, the developer created the list of reportsw by selecting WHERE ScheduledTime > TimeRightNow - this doesn't work if the time the report is scheduled for has passed (because, for example, teh previous report took a long time to run) - you need to include rpeorts based on whether the report has been run for the last scheduled time, not whether that time has passed.

___________________________________________
.\\axxx
(That's an 'M')

GeneralRe: Reports every Monday at 7am. Pin
Jacob Dixon25-May-09 15:26
Jacob Dixon25-May-09 15:26 
AnswerRe: Reports every Monday at 7am. Pin
Jacob Dixon25-May-09 15:36
Jacob Dixon25-May-09 15:36 
GeneralRe: Reports every Monday at 7am. Pin
_Maxxx_25-May-09 19:05
professional_Maxxx_25-May-09 19:05 
QuestionPop ContextMenu on NotifyIcon without mouse activity Pin
jackgeek25-May-09 5:58
jackgeek25-May-09 5:58 
QuestionRe: Pop ContextMenu on NotifyIcon without mouse activity Pin
jackgeek29-May-09 12:23
jackgeek29-May-09 12:23 
QuestionNeed help with TableAdapter problem [modified] Pin
kensai25-May-09 5:01
kensai25-May-09 5:01 
AnswerRe: Need help with TableAdapter problem Pin
Fahad Sadah25-May-09 7:28
Fahad Sadah25-May-09 7:28 
GeneralRe: Need help with TableAdapter problem Pin
kensai25-May-09 23:48
kensai25-May-09 23:48 
AnswerRe: Need help with TableAdapter problem Pin
kensai26-May-09 0:13
kensai26-May-09 0:13 
QuestionFile types Pin
viciouskinid25-May-09 4:13
viciouskinid25-May-09 4:13 
AnswerRe: File types Pin
harold aptroot25-May-09 4:44
harold aptroot25-May-09 4:44 
GeneralRe: File types Pin
viciouskinid25-May-09 5:17
viciouskinid25-May-09 5:17 
GeneralRe: File types Pin
harold aptroot25-May-09 5:31
harold aptroot25-May-09 5:31 
GeneralRe: File types Pin
viciouskinid25-May-09 7:07
viciouskinid25-May-09 7:07 
GeneralRe: File types Pin
harold aptroot25-May-09 7:28
harold aptroot25-May-09 7:28 
GeneralRe: File types Pin
viciouskinid25-May-09 8:19
viciouskinid25-May-09 8:19 
GeneralRe: File types Pin
harold aptroot25-May-09 8:35
harold aptroot25-May-09 8:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.