Automatic report generation help

Fill out the main text window with the times. reports, workgroups, and email addresses to be sent.  The standard copy (Ctrl Insert) and paste (Shift Insert) shortcuts can be used to fill out the text window.  Separate the fields with spaces, not tabs.

An example of filling out the main text box is shown below:

Days           Time      Report    WorkGroup  Email Address	    Last Executed

;Days          Time      Report    WorkGroup  Email Address     Last Executed
MoTuWeThFrSaSu 00:00     LogSort     CIA      joe@xyzmail.com
MoTuWeThFrSaSu 00:00G+01 Exception   CIA;CIB  moe@xyzmail.com;tim@xyzmail.com
WeThSaSu       15:05     Certificate All      sam@xyzmail.com 
Su             15:06     Monthly     All      bob@xyzmail.com 
WeThSaSu       15:07     DailyLog    All      sue@xyzmail.com 
WeThSaSu       15:10     GetNames    All      NO
WeThSaSu       15:10     SendNames   All      NO

Any line beginning with a semicolon will be ignored as a comment.

Possible entries for Days:
  MoTuWeThFrSaSu    (one or more of)
  La (Last day of month)
  Fi (First day of month)

Possible entries for Time:
  01:23  (hour in 24 hr format : minute).  If the data in the log.txt file was generated in a different time zone (such as GMT-1), then add a "G+01" suffix to the report time.  This will change the time that the report was generated, but not change the time search parameters in a report.  For example, to run an exception report for workgroup IAA in Ireland at 4AM GMT, on a server located in New York (11PM EDST), the line in the GenReport.txt task scheduler script might look like: "MoTuWeThFrSaSu  04:00G-0  Exception   IAA   joe@xyz.com", which would run an exception report at 23:00 EDST (i.e. 04:00GMT) of all employees in the IAA group who had not tested as of 04:00 (AM) the next day, and email the report to joe@xyz.com.

Possible entries for report:
  LogSort (Lo)        Combines the log.txt files from the test stations and sorts them
  Exception  (Ex)     Report of employees who have not passed the test
  2Exception (2E)     Report of employees who have not tested before and after a break 
  Certification (Ce)  Report of the status of the employee training certifications
  Daily (Da)          Report of the daily test log
  Monthly (Mo)        Report of tests summarized by month
  GetNames (Ge)       Combines the name.txt files from the test stations
  SendNames (Se)      Sends the server names.txt file to the test stations
  BackupNames (Ba)    Backs up the names.txt file through 7 rotations
  M1Task (M1)         Executes a custom batch program named M1.bat
  M2Task (M2)         Executes a custom batch program named M2.bat
  M3Task (M3)         Executes a custom batch program named M3.bat
  M4Task (M4)         Executes a custom batch program named M4.bat
  M5Task (M5)         Executes a custom batch program named M5.bat
  Training (Tr)       Imports the training course status to the names.txt file 
  Update (Up)         Updates and deletes employee info from the names.txt file
  Vacation (Va)       Report of employees sick and vacation schedules
  DownloadLog (Do)    Imports the remote data base measurements to the log.txt file
  NdownloadNames (Nd) Imports the remote data base names info to the names.txt file
  Occupancy (Oc)      Report of the employees who have not signed out
  OperationMsgs (Op)  Sends the Operations.txt operation messages file

LogSort  will read all the test stations (that are listed in the netlist.txt file) log.txt files and combine and sort them into one log.txt file on the server.

Exception will generate an exception report of workers who failed the test or did not test. The exception report will list employees that have not yet within the last 12 hours that the report was run.  To prevent second shift employees (who test at 4PM) from showing up on the 7AM exception report, assign them different workgroups (like SH1 and SH2) and run the 7AM exception report for the SH1 workgroup only, and run the 4PM exception report for the SH2 workgroup only.

2Exception will generate an exception report of workers who did not test twice within the last 12 hours.  Tests must be separated by 3 hours or more.

Certification will generate a report of workers who's certification period has expired.

Daily will generate a report of test values for the day.  If the "exit" feature is used, this will list both the test time  and the exit time on the same line.

Monthly will generate the monthly summary report.

GetNames will read all the test stations' names.txt files and combine any newly added names into the server's names.txt file, and call BackupNames.

SendNames will send the names.txt file to the test stations listed in the netlist.txt file.
M1Task will launch (and execute what ever is in) your custom M1Task.bat file (such as copying report files from one computer to another), but will not wait for M1Task.bat to finish.
M2Task - M5Task will likewise execute M2Task.bat - M5Task.bat. 

BackupNames will backup the names.txt data file through seven rotations, so call this once per day for a complete weekly backup.  It  will backup the names data file names.txt.  It should be called once each day,  It will: delete NamesBakRot7.txt, rename  NamesBakRot6.txt to NamesBakRot7.txt, rename  NamesBakRot5.txt to NamesBakRot6.txt, .... rename  NamesBakRot1.txt to NamesBakRot2.txt, and copy  Names.txt to NamesBakRot1.txt.  Thus you will have seven days to recover a names.txt file before it gets deleted.  This function can be automatically called from the Autogenerate email task scheduler.

Training will read the optional Certification training course data files to see which employees have passed the retraining exam, and generate a report.  Refer to the Help.txt file Installation step 30 on how to Setup Certification Configuration.

Update will update employees that are in the names.txt data base with the latest info in the remote data base, and remove employees that are not in a remote data base from the names.txt file, and email a report showing the names that were removed.  The remote data base settings are in the Setup Remote data base window.

DownloadLog will import the remote data base measurements to the log.txt file.  WARNING - all previous data in the log.txt file will be overwritten.  This function can not be called from a test station that is configured to send buffered measurement data to the remote data base, because all the data would then be sent back again to the data base the next time a measurement was made, since the buffering is done in the log.txt file.

NdownloadNames imports the remote data base names info to the names.txt file.  WARNING - all previous data in the names.txt file will be overwritten

Occupancy will generate a report of the employees who have conducted a test, but not signed out (i.e. not scanned their badge on the way out without pressing the test button).

Possible entries for Workgroup:
  any legitimate predefined workgroup designator
  any concatenation of the other predefined workgroup designators with semicolons but no spaces
           e.g. CIA;CIB;CIC
  the word ALL   - will use all workgroups

Possible entries for Email addresses:
  any legitimate email address e.g. joe@xyzmail.com
  any concatenation of email addresses using a semicolon but no spaces 
e.g. joe@xyzmail.com;moe@xyzmail.com
  the word NO (or any word less than 4 letters) to generate a report but not email it

Possible entries for Last Executed:
  the program will fill this in when the report is run
  Delete the entry or leave it blank to run the report today, 
     or press the Clear Time button to clear all the Last Executed times.

Control buttons:
  Start will begin executing the tasks.  The window must stay open and "started" to continue running the tasks.
  Pause/Edit will stop executing the tasks and allow editing.
  Save will save the edited task schedule to the GenReports.txt file.
  Undo will undo editing since the last save.
  Clear Times will clear the last executed times to rerun all today's previous tasks for testing.
  Cancel will stop the program and close the window.
     to continue executing tasks but hide the window, just click on the window behind it.  


Other Notes:
The program requires that a MAPI email program be installed such as Microsoft Outlook Express or Outlook 2000 (Outlook 2002 requires administrator security overides).  The email messages will be placed in the Outlook outbox.  Set up Outlook to automatically send the email outbox every 10 minutes or so.

There are three check boxes at the bottom of the window:
   Check the one labeled "Include Message" to include the report in the email message body
   Check the one labeled "Attach .txt file to attache the report as a .txt file
   Check the one labeled "Attach .csv file to attache the report as a .csv file
Note that at least one of these must be checked or the default will be the message body with the .csv file attached.


LogSort Notes:
If LogSort is run, it should be from the server computer.
Selecting LogSort as a report will backup and combine the test station log.txt files.  It will:
	a. Rotate the backup logbak1.txt file to logbak2.txt. 
	b. Rotate the log.txt file to logbak1.txt.
	c. Append (and sort if needed) the test station Log.txt files to the server Log.txt file.
	d. Append each test stations's Log.txt file to its own LogHist.txt file.
	e. Delete each test station's Log.txt file.
Errors will be ignored.  The LogSort function will combine the data either from four workstations on drives I:, J:, K:, and L if a NetList.txt file does not exist.  For other drives or network computers, place the complete file path on a line in the NetList.txt file.

Thus the Netlist.txt file will look something like:

\\teststation1\EsdTest
\\teststation2\EsdTest
\\teststation3\EsdTest
\\teststation4\EsdTest

or for some operating setups may look like:

\\teststation1\c:\EsdTest
\\teststation2\c:\EsdTest
\\teststation3\c:\EsdTest
\\teststation4\c:\EsdTest

If the Log.txt, LogBak1.txt, and LogBak2.txt files grow too large, then 
	a. delete the Logbak1.txt file 
	b. delete the LogBak2.txt file
	c. backup the Log.txt file to an external disk or tape drive if desired
	d. either delete the Log.txt file, or use a text editor to remove the old unwanted data.

The Log.txt file should be reset periodically to prevent it from growing so huge that it slows down report processing.  Click on "setup" and then select the "Reset Log File" item.  It will ask for a backup file name.
For very large companies, it may be desirable to backup the log.txt file to a monthly backup file (for example Log0699.txt for June 1999). For small companies, this should be done at least once per year on January 1st.

Every January 1st, the LogHist.txt on the test station computers should also be deleted.

Microsoft recently added major security updates to Outlook 2002 which prevents other programs (such as EsdTest) from using it to send MAPI email messages without popping up a warning message  "A program is automatically trying to send email on your behalf."
 The solutions are:
* Use the SMTP method instead.  Click Setup Email to open the Email configuration window.
* if your company is using Microsoft Outlook 2002 with Microsoft the Exchange Server, then have the administrator set up a public Outlook security folder to disable the warnings (see the Microsoft Knowledge Base Article # 263297)
* switch to Outlook Express (which is not fully compliant with Microsoft Exchange) or another MAPI compliant email program 
* or switch to Outlook 2000 without the email security update,
* or download ClickYes Pro from http://www.contextmagic.com/express-clickyes/ and modify the Outlook security settings
* or download the free Express ClickYes program from http://www.contextmagic.com/express-clickyes/  (set it to always be suspended)
* or install the ClickYesSetup.exe file included on the installtion CD.  This will automatically dismiss the message. (Set it to always be suspended)
* 

To use Outlook Express instead of Outlook as the MAPI client, 
 - either right click on your Internet Explorer icon and click properties, or open Internet Explorer and click Tools, Internet options 
 - click the "Programs" tab 
 - select "Outlook Express" in the E-mail box. 
 - click OK

Troubleshooting:
If you do not receive a report please:
1. Check in the server Outlook Express Outbox Sent box and see if got sent.  If it did get sent, then the problem may be in your spam filter or your company's email server.
2. If it is not in the Sent box, see if it is in the Out box, in which case your company's smtp server had a problem sending it.
3. If it is not in the Out box then make sure the Autogenerate window is still open and that the Start button is grayed out - meaning that the report program is still running, and no one accidentally shut it off.  Accidental shutoff can be prevented in program versions 6.72 and later by activating the esdtest administrator password. 
4. If no one shut the program off, then check the Last Executed column in the Autogenerate window and see when the last report was sent.  If the last report was sent at the scheduled time, then there is a problem with your mapi mail programs on your server - try rebooting.
5. If the last report executed did not execute at the scheduled time, check the server's computer clock and date setting. Move the mouse to the lower right of the screen and right click on the time, and then choose Adjust Time/Date to see the date.
6. If the date is correct, then click the Pause/Edit button in the Autogenerate window, and then click the Start button again.  Make sure that the scheduled report information looks OK, especially the top line, and that the file has not been corrupted, and that the format looks te same as the examples above.  Also check the Last Executed column to make sure no dates in the future have been inserted.


File backups:
GetNames (but not SendNames) will automatically backup the new combined names.txt file whenever it is run, on a 2 run rotation.
It will backup Namesbak1.txt to Namesbak2.txt then backup Names.txt to Namesbak1.txt, so you will need to catch it within 2 executions befores the backups are totally overwritten.
 
If you want a longer rotation, our AutoGen Report scheduler has the capability of running your own custom .bat files, so you can run any rotation schedule or to any computer you desire.
 
For example, to backup the names.txt file once per day on a 7 day rotation you could write a file named M1Task.bat as follows
 
xcopy namesB6.txt namesB7.txt  /Y /C
xcopy namesB5.txt namesB6.txt  /Y /C
xcopy namesB4.txt namesB5.txt  /Y /C
xcopy namesB3.txt namesB4.txt  /Y /C
xcopy namesB2.txt namesB3.txt  /Y /C
xcopy namesB1.txt namesB2.txt  /Y /C
xcopy names.txt   namesB1.txt  /Y /C
 
(might have to specify path if default path is different, i.e.) 
xcopy c:\EsdTest\names.txt   c:\EsdTest\namesB1.txt  /Y /C
 
The /Y and /C prevent the xcopy command from stopping on errors.  Place the M1Task.bat file in the same directory as the EsdTest.exe file, which is usually the c:\EsdTest directory.
 
and insert the following line into the AutoGenerate Task scheduler:
 
MoTuWeThFrSaSu 06:00 M1Task     all      no
 
 
 
In addition, you could even do a 4 week rotation by the following lines to a file named M2Task.bat:
xcopy namesW3.txt namesW4.txt  /Y /C
xcopy namesW2.txt namesW3.txt  /Y /C
xcopy namesW1.txt namesW2.txt  /Y /C
xcopy names.txt   namesW1.txt  /Y /C
 
 
and insert the following line into the AutoGenerate Task scheduler:
 
Fr 06:05 M2Task     all      no

