Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/AssemblyInfo.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/AssemblyInfo.cs	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/AssemblyInfo.cs	(revision 788)
@@ -10,5 +10,5 @@
 [assembly: AssemblyDescription("Windows Scheduling Application")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Indian Health Service")]
+[assembly: AssemblyCompany("WorldVistA")]
 [assembly: AssemblyProduct("")]
 [assembly: AssemblyCopyright("")]
@@ -27,5 +27,5 @@
 // by using the '*' as shown below:
 
-[assembly: AssemblyVersion("2.1.*")]
+[assembly: AssemblyVersion("2.2.*")]
 
 //
@@ -57,3 +57,3 @@
 [assembly: AssemblyKeyFile("")]
 [assembly: AssemblyKeyName("")]
-[assembly: AssemblyFileVersionAttribute("2.1.0.0")]
+[assembly: AssemblyFileVersionAttribute("2.2.0.0")]
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs	(revision 788)
@@ -3,13 +3,8 @@
 using System.Collections;
 using System.Data;
-using System.Text;
 using System.Diagnostics;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using System.IO;
 using IndianHealthService.BMXNet;
-using System.Configuration;
 using Mono.Options;
+using System.Runtime.InteropServices;
 
 namespace IndianHealthService.ClinicalScheduling
@@ -259,10 +254,8 @@
                                 && m_VerifyCode != String.Empty)
                                 m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, m_AccessCode, m_VerifyCode);
-
                             else if (m_Server != String.Empty && m_Port != 0)
-                                m_ConnectInfo.LoadConnectInfo(m_Server, m_Port);
-
+                                m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, "", "");
                             else
-							    m_ConnectInfo.LoadConnectInfo();
+                                m_ConnectInfo.LoadConnectInfo();
                         }
 						bRetry = false;
@@ -347,11 +340,22 @@
 		}
 
-		[STAThread()] static void Main(string[] args)
-		{
+        //To write to the console
+        [DllImport("kernel32.dll")]
+        static extern bool AttachConsole(int dwProcessId);
+        private const int ATTACH_PARENT_PROCESS = -1;
+
+		[STAThread()] 
+        static void Main(string[] args)
+		{
+#if DEBUG
+            // Print console messages to console if launched from console
+            AttachConsole(ATTACH_PARENT_PROCESS);
+#endif
             try
-            {   
+            {
                  //Store the current manager
                 _current = new CGDocumentManager();
                 
+                //Get command line options; store in private variables
                 var opset = new OptionSet () {
                     { "s=", s => _current.m_Server = s },
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs	(revision 788)
@@ -83,5 +83,5 @@
 		private System.Windows.Forms.MenuItem menuItem6;
 		private System.Windows.Forms.MenuItem menuItem7;
-		private System.Windows.Forms.MenuItem mnuPrintClinicLetters;
+		private System.Windows.Forms.MenuItem mnuPrintReminderLetters;
 		private System.Windows.Forms.MenuItem mnuPrintPatientLetter;
 		private System.Windows.Forms.MenuItem mnuPrintClinicSchedules;
@@ -213,5 +213,5 @@
             this.menuItem6 = new System.Windows.Forms.MenuItem();
             this.mnuPrintClinicSchedules = new System.Windows.Forms.MenuItem();
-            this.mnuPrintClinicLetters = new System.Windows.Forms.MenuItem();
+            this.mnuPrintReminderLetters = new System.Windows.Forms.MenuItem();
             this.mnuPrintRebookLetters = new System.Windows.Forms.MenuItem();
             this.mnuPrintCancellationLetters = new System.Windows.Forms.MenuItem();
@@ -311,5 +311,5 @@
             this.menuItem6,
             this.mnuPrintClinicSchedules,
-            this.mnuPrintClinicLetters,
+            this.mnuPrintReminderLetters,
             this.mnuPrintRebookLetters,
             this.mnuPrintCancellationLetters,
@@ -365,4 +365,5 @@
             // 
             this.mnuSchedulingManagment.Index = 7;
+            this.mnuSchedulingManagment.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftM;
             this.mnuSchedulingManagment.Text = "Scheduling &Management";
             this.mnuSchedulingManagment.Click += new System.EventHandler(this.mnuSchedulingManagment_Click);
@@ -380,9 +381,10 @@
             this.mnuPrintClinicSchedules.Click += new System.EventHandler(this.mnuPrintClinicSchedules_Click);
             // 
-            // mnuPrintClinicLetters
-            // 
-            this.mnuPrintClinicLetters.Index = 10;
-            this.mnuPrintClinicLetters.Text = "Print Rem&inder Letters";
-            this.mnuPrintClinicLetters.Click += new System.EventHandler(this.mnuPrintClinicLetters_Click);
+            // mnuPrintReminderLetters
+            // 
+            this.mnuPrintReminderLetters.Index = 10;
+            this.mnuPrintReminderLetters.Shortcut = System.Windows.Forms.Shortcut.CtrlR;
+            this.mnuPrintReminderLetters.Text = "Print Rem&inder Letters";
+            this.mnuPrintReminderLetters.Click += new System.EventHandler(this.mnuPrintReminderLetters_Click);
             // 
             // mnuPrintRebookLetters
@@ -395,4 +397,5 @@
             // 
             this.mnuPrintCancellationLetters.Index = 12;
+            this.mnuPrintCancellationLetters.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftC;
             this.mnuPrintCancellationLetters.Text = "Print C&ancellation Letters";
             this.mnuPrintCancellationLetters.Click += new System.EventHandler(this.mnuPrintCancellationLetters_Click);
@@ -1787,9 +1790,6 @@
 					sClinicList = sClinicList + sRes + "|";	
 				}
-				string sSql = "BSDX REBOOK LIST^" + sApptIDList;
-				DataTable dtLetters = m_DocManager.RPMSDataTable(sSql, "PatientAppts");
-				DPatientLetter dpl = new DPatientLetter();
-					
-				dpl.InitializeFormRebookLetters(this.DocManager, sClinicList, dtLetters);
+				DPatientLetter dpl = new DPatientLetter();					
+				dpl.InitializeFormRebookLetters(this.DocManager, sClinicList, sApptIDList);
 				dpl.ShowDialog(this);
 			}		
@@ -2915,5 +2915,5 @@
 		}
 
-		private void mnuPrintClinicLetters_Click(object sender, System.EventArgs e)
+		private void mnuPrintReminderLetters_Click(object sender, System.EventArgs e)
 		{
 			try
@@ -2931,5 +2931,5 @@
 
 				DPatientLetter dpl = new DPatientLetter();
-				dpl.InitializeFormClinicLetters(this.DocManager, sClinics, dtBegin, dtEnd);
+				dpl.InitializeFormPatientReminderLetters(this.DocManager, sClinics, dtBegin, dtEnd);
 				dpl.ShowDialog(this);
 
@@ -2951,19 +2951,7 @@
 					return;
 
-				//get the resource names and call the letter printer
-
-				string sClinics = ds.SelectedClinics;
-				DateTime dtBegin = ds.BeginDate;
-				DateTime dtEnd = ds.EndDate;
-				string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");
-				string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");
-
+				//Call the letter printer
 				DPatientLetter dpl = new DPatientLetter();
-				
-				//Call RPC to get list of appt ids that have been rebooked for these clinics on these dates
-				string sSql = "BSDX REBOOK CLINIC LIST^" + sClinics + "^" + sBegin + "^" + sEnd;
-				DataTable dtLetters = DocManager.RPMSDataTable(sSql, "PatientAppts");
-
-				dpl.InitializeFormRebookLetters(this.DocManager, sClinics, dtLetters);
+                dpl.InitializeFormRebookLetters(this.DocManager, ds.SelectedClinics, ds.BeginDate, ds.EndDate);
 				dpl.ShowDialog(this);
 
@@ -3060,16 +3048,9 @@
 				DateTime dtBegin = ds.BeginDate;
 				DateTime dtEnd = ds.EndDate;
-				string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");
-				string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");
 
 				DPatientLetter dpl = new DPatientLetter();
 				
-				//Call RPC to get list of appt ids that have been cancelled for these clinics on these dates
-				string sSql = "BSDX CANCEL CLINIC LIST^" + sClinics + "^" + sBegin + "^" + sEnd;
-				DataTable dtLetters = DocManager.RPMSDataTable(sSql, "PatientAppts");
-
-				dpl.InitializeFormCancellationLetters(this.DocManager, sClinics, dtLetters);
+				dpl.InitializeFormCancellationLetters(this.DocManager, sClinics, dtBegin, dtEnd);
 				dpl.ShowDialog(this);
-
 			}
 			catch(Exception ex)
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj	(revision 788)
@@ -43,5 +43,4 @@
     <SignManifests>false</SignManifests>
     <TargetZone>LocalIntranet</TargetZone>
-    <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
     <PublishUrl>publish\</PublishUrl>
     <Install>true</Install>
@@ -59,4 +58,5 @@
     <PublishWizardCompleted>true</PublishWizardCompleted>
     <BootstrapperEnabled>true</BootstrapperEnabled>
+    <NoWin32Manifest>true</NoWin32Manifest>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -81,4 +81,5 @@
     <DebugType>full</DebugType>
     <ErrorReport>prompt</ErrorReport>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -104,4 +105,5 @@
     <DebugType>none</DebugType>
     <ErrorReport>prompt</ErrorReport>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
   </PropertyGroup>
   <ItemGroup>
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user	(revision 788)
@@ -36,6 +36,5 @@
     </RemoteDebugMachine>
     <StartAction>Project</StartAction>
-    <StartArguments>
-    </StartArguments>
+    <StartArguments>/s=192.168.254.129 /p=9260 /a=shabiel12 /v=catdog.44</StartArguments>
     <StartPage>
     </StartPage>
@@ -56,6 +55,5 @@
     </RemoteDebugMachine>
     <StartAction>Project</StartAction>
-    <StartArguments>
-    </StartArguments>
+    <StartArguments>/s=192.168.254.129 /p=9260 /a=shabiel12 /v=catdog.44</StartArguments>
     <StartPage>
     </StartPage>
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs	(revision 788)
@@ -16,14 +16,30 @@
 		/// </summary>
         private System.ComponentModel.Container components = null;
-        private System.Drawing.Printing.PrintDocument printDocument1;
+        private System.Drawing.Printing.PrintDocument printAppts;
+        private System.Drawing.Printing.PrintDocument printReminderLetters;
 
 		#region Fields
         DateTime _dtBegin, _dtEnd; //global fields to use in passing to printing method
+        
+        //stuff to track what got printed and where we are -- very ugly, I know
+        //but I don't know if there is a better way to do it.
         int _currentResourcePrinting = 0;
         int _currentApptPrinting = 0;
-        dsPatientApptDisplay2 _ds;
+        int _pageNumber = 0;
+        
+        //dataset to load the results of queries into and set to print routines
+        dsPatientApptDisplay2 _dsApptDisplay;
+        private PrintDocument printCancelLetters;
+        dsRebookAppts _dsRebookAppts;
 		#endregion Fields
 
-		public void InitializeFormClinicSchedule(CGDocumentManager docManager,
+		/// <summary>
+		/// Print Clinic Schedules
+		/// </summary>
+		/// <param name="docManager">This docManger</param>
+		/// <param name="sClinicList">Clinics for which to print</param>
+		/// <param name="dtBegin">Beginning Date</param>
+		/// <param name="dtEnd">End Date</param>
+        public void InitializeFormClinicSchedule(CGDocumentManager docManager,
 			string sClinicList,
 			DateTime dtBegin,
@@ -45,7 +61,9 @@
                 string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
 
-                _ds = new dsPatientApptDisplay2();
-                _ds.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
-                _ds.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
+                _dsApptDisplay = new dsPatientApptDisplay2();
+                _dsApptDisplay.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+                _dsApptDisplay.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
+
+                this.PrintPreviewControl.Document = printAppts;
             }
 			catch (Exception ex)
@@ -57,5 +75,6 @@
 		public void InitializeFormRebookLetters(CGDocumentManager docManager,
 			string sClinicList,
-			DataTable dtLetters)
+		    DateTime dtBegin,
+            DateTime dtEnd)
 		{
 			try
@@ -66,11 +85,14 @@
 				}
 
-				System.Data.DataSet ds = new System.Data.DataSet();
-				ds.Tables.Add(dtLetters.Copy());
+                string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");
+                string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");
+
+                //Call RPC to get list of appt ids that have been rebooked for these clinics on these dates
+                string sSql1 = "BSDX REBOOK CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;
+                DataTable dtLetters = docManager.RPMSDataTable(sSql1, "PatientAppts");
 				
-				string sSql = "BSDX RESOURCE LETTERS^" + sClinicList;
-				DataTable dt = docManager.RPMSDataTable(sSql, "Resources");				
-				ds.Tables.Add(dt.Copy());				
-			}
+				string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+				DataTable dt = docManager.RPMSDataTable(sSql2, "Resources");				
+            }
 			catch (Exception ex)
 			{
@@ -78,9 +100,40 @@
 			}
 		}
-
+        public void InitializeFormRebookLetters(CGDocumentManager docManager,
+            string sClinicList,
+            string sApptIDList)
+        {
+            try
+            {
+                if (sClinicList == "")
+                {
+                    throw new Exception("At least one clinic must be selected.");
+                }
+
+                string sSql = "BSDX REBOOK LIST^" + sApptIDList;
+                DataTable dtLetters = docManager.RPMSDataTable(sSql, "PatientAppts");
+
+                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+                DataTable dt = docManager.RPMSDataTable(sSql2, "Resources");
+
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
+
+        /// <summary>
+        /// Print Cancellation letters to mail to patients
+        /// </summary>
+        /// <param name="docManager">This Docmanager</param>
+        /// <param name="sClinicList">| delemited clinic list (IEN's)</param>
+        /// <param name="dtBegin">Beginning Date</param>
+        /// <param name="dtEnd">Ending Date</param>
 		public void InitializeFormCancellationLetters(CGDocumentManager docManager,
 			string sClinicList,
-			DataTable dtLetters)
-		{
+            DateTime dtBegin,
+            DateTime dtEnd)
+        {
 			try
 			{	
@@ -90,11 +143,17 @@
 				}
 
-				System.Data.DataSet ds = new System.Data.DataSet();
-				ds.Tables.Add(dtLetters.Copy());
-				
-				string sSql = "BSDX RESOURCE LETTERS^" + sClinicList;
-				DataTable dt = docManager.RPMSDataTable(sSql, "Resources");				
-				ds.Tables.Add(dt.Copy());
-				
+                string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");
+                string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");
+
+                //Call RPC to get list of appt ids that have been cancelled for these clinics on these dates
+                string sSql1 = "BSDX CANCEL CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;
+				string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsRebookAppts = new dsRebookAppts();
+                _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts"));
+                _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+
+                PrintPreviewControl.Document = printCancelLetters;
+
 			}
 			catch (Exception ex)
@@ -103,6 +162,12 @@
 			}
 		}
-
-		public void InitializeFormClinicLetters(CGDocumentManager docManager,
+        /// <summary>
+        /// Print Reminder Letters to give or mail to patients
+        /// </summary>
+        /// <param name="docManager">This docManger</param>
+        /// <param name="sClinicList">Clinics for which to print</param>
+        /// <param name="dtBegin">Beginning Date</param>
+        /// <param name="dtEnd">End Date</param>
+        public void InitializeFormPatientReminderLetters(CGDocumentManager docManager,
 			string sClinicList,
 			DateTime dtBegin,
@@ -115,18 +180,20 @@
 					throw new Exception("At least one clinic must be selected.");
 				}
+
+                _dtBegin = dtBegin;
+                _dtEnd = dtEnd;
+                string sBegin = dtBegin.ToShortDateString();
+                string sEnd = dtEnd.ToShortDateString();
+                this.Text = "Clinic Schedules";
+
+                string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd;
+                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsApptDisplay = new dsPatientApptDisplay2();
+                _dsApptDisplay.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+                _dsApptDisplay.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
+
+                this.PrintPreviewControl.Document = printReminderLetters;
 				
-				string sBegin = dtBegin.ToShortDateString();
-				string sEnd = dtEnd.ToShortDateString();
-
-				string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd;
-
-				System.Data.DataSet ds = new System.Data.DataSet();
-				DataTable dtAppt = docManager.RPMSDataTable(sSql, "PatientAppts");				
-				ds.Tables.Add(dtAppt.Copy());
-				
-				sSql = "BSDX RESOURCE LETTERS^" + sClinicList;
-				DataTable dt = docManager.RPMSDataTable(sSql, "Resources");				
-				ds.Tables.Add(dt.Copy());
-				
 			}
 			catch (Exception ex)
@@ -137,5 +204,5 @@
 
 
-		public DPatientLetter()
+		public DPatientLetter() : base()
 		{
 			//
@@ -171,10 +238,20 @@
 		private void InitializeComponent()
 		{
-            this.printDocument1 = new System.Drawing.Printing.PrintDocument();
+            this.printAppts = new System.Drawing.Printing.PrintDocument();
+            this.printReminderLetters = new System.Drawing.Printing.PrintDocument();
+            this.printCancelLetters = new System.Drawing.Printing.PrintDocument();
             this.SuspendLayout();
             // 
-            // printDocument1
-            // 
-            this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
+            // printAppts
+            // 
+            this.printAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printAppts_PrintPage);
+            // 
+            // printReminderLetters
+            // 
+            this.printReminderLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printReminderLetters_PrintPage);
+            // 
+            // printCancelLetters
+            // 
+            this.printCancelLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printCancelLetters_PrintPage);
             // 
             // DPatientLetter
@@ -182,5 +259,4 @@
             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
             this.ClientSize = new System.Drawing.Size(648, 398);
-            this.Document = this.printDocument1;
             this.Name = "DPatientLetter";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -191,9 +267,12 @@
 		#endregion
 
-        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
-        {
+        private void printAppts_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+        {
+            //Each time we enter here, we start off with a new page number - we start off with zero
+            _pageNumber++; //becomes one first time through
+            
             // _currentResourcePrinting starts with zero. There will be at least this one.
-            ClinicalScheduling.Printing.PrintAppointments(_ds, e, _dtBegin, _dtEnd,
-                    _currentResourcePrinting, ref _currentApptPrinting);
+            ClinicalScheduling.Printing.PrintAppointments(_dsApptDisplay, e, _dtBegin, _dtEnd,
+                    _currentResourcePrinting, ref _currentApptPrinting, _pageNumber);
 
             //If the printing routine says it needs more pages to print the appointments,
@@ -203,10 +282,53 @@
             // if there are more resouces to print, increment. Setting HasMorePages to true
             // calls this routine again, so printing will happen with the incremented _currentResourcePrinting
-            if (_currentResourcePrinting < _ds.BSDXResource.Rows.Count - 1)
+            if (_currentResourcePrinting < _dsApptDisplay.BSDXResource.Rows.Count - 1)
             {
                 _currentResourcePrinting++;
+                //reset _currentApptPrinting
+                _currentApptPrinting = 0;
                 e.HasMorePages = true;
+            }            
+        }
+
+        private void printReminderLetters_PrintPage(object sender, PrintPageEventArgs e)
+        {
+            // no patients
+            if (_dsApptDisplay.PatientAppts.Count == 0)
+            {
+                ClinicalScheduling.Printing.PrintMessage("No Appointments found", e);
+                return;
+            }
+            // if there are patients
+            else if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count)
+            {
+                dsPatientApptDisplay2.BSDXResourceRow c = (dsPatientApptDisplay2.BSDXResourceRow)
+                   _dsApptDisplay.PatientAppts[_currentApptPrinting].GetParentRow(_dsApptDisplay.Relations[0]);
+                ClinicalScheduling.Printing.PrintReminderLetter(_dsApptDisplay.PatientAppts[_currentApptPrinting], e, c.LETTER_TEXT, "Reminder Letter");
+                _currentApptPrinting++;
+                if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count)
+                    e.HasMorePages = true;
             }
             
+        }
+
+        private void printCancelLetters_PrintPage(object sender, PrintPageEventArgs e)
+        {
+            // no patients
+            if (_dsRebookAppts.PatientAppts.Count == 0)
+            {
+                ClinicalScheduling.Printing.PrintMessage("No Appointments found", e);
+                return;
+            }
+            // if there are patients
+            else if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
+            {
+                dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow)
+                   _dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]);
+                ClinicalScheduling.Printing.PrintCancelLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.CLINIC_CANCELLATION_LETTER, "Cancellation Letter");
+                _currentApptPrinting++;
+                if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
+                    e.HasMorePages = true;
+            }
+
         }
 	}
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.resx
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.resx	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.resx	(revision 788)
@@ -118,6 +118,12 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="printDocument1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="printAppts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>116, 17</value>
   </metadata>
+  <metadata name="printReminderLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>218, 17</value>
+  </metadata>
+  <metadata name="printCancelLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>374, 17</value>
+  </metadata>
 </root>
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DSelectLetterClinics.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DSelectLetterClinics.cs	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DSelectLetterClinics.cs	(revision 788)
@@ -50,4 +50,5 @@
             this.AcceptButton = cmdOK;
             this.CancelButton = cmdCancel;
+            this.chkSelectAll.Focus();
 		}
 
@@ -74,187 +75,186 @@
 		private void InitializeComponent()
 		{
-			this.pnlOkCancel = new System.Windows.Forms.Panel();
-			this.cmdCancel = new System.Windows.Forms.Button();
-			this.cmdOK = new System.Windows.Forms.Button();
-			this.pnlDescription = new System.Windows.Forms.Panel();
-			this.grpDescription = new System.Windows.Forms.GroupBox();
-			this.lblDescription = new System.Windows.Forms.Label();
-			this.lstResource = new System.Windows.Forms.CheckedListBox();
-			this.cboResourceGroup = new System.Windows.Forms.ComboBox();
-			this.label1 = new System.Windows.Forms.Label();
-			this.label2 = new System.Windows.Forms.Label();
-			this.dtBegin = new System.Windows.Forms.DateTimePicker();
-			this.dtEnd = new System.Windows.Forms.DateTimePicker();
-			this.lblRange = new System.Windows.Forms.Label();
-			this.label4 = new System.Windows.Forms.Label();
-			this.label5 = new System.Windows.Forms.Label();
-			this.chkSelectAll = new System.Windows.Forms.CheckBox();
-			this.pnlOkCancel.SuspendLayout();
-			this.pnlDescription.SuspendLayout();
-			this.grpDescription.SuspendLayout();
-			this.SuspendLayout();
-			// 
-			// pnlOkCancel
-			// 
-			this.pnlOkCancel.Controls.Add(this.cmdCancel);
-			this.pnlOkCancel.Controls.Add(this.cmdOK);
-			this.pnlOkCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
-			this.pnlOkCancel.Location = new System.Drawing.Point(0, 430);
-			this.pnlOkCancel.Name = "pnlOkCancel";
-			this.pnlOkCancel.Size = new System.Drawing.Size(512, 40);
-			this.pnlOkCancel.TabIndex = 4;
-			// 
-			// cmdCancel
-			// 
-			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-			this.cmdCancel.Location = new System.Drawing.Point(416, 8);
-			this.cmdCancel.Name = "cmdCancel";
-			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
-			this.cmdCancel.TabIndex = 1;
-			this.cmdCancel.Text = "Cancel";
-			// 
-			// cmdOK
-			// 
-			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
-			this.cmdOK.Location = new System.Drawing.Point(336, 8);
-			this.cmdOK.Name = "cmdOK";
-			this.cmdOK.Size = new System.Drawing.Size(64, 24);
-			this.cmdOK.TabIndex = 0;
-			this.cmdOK.Text = "OK";
-			// 
-			// pnlDescription
-			// 
-			this.pnlDescription.Controls.Add(this.grpDescription);
-			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
-			this.pnlDescription.Location = new System.Drawing.Point(0, 350);
-			this.pnlDescription.Name = "pnlDescription";
-			this.pnlDescription.Size = new System.Drawing.Size(512, 80);
-			this.pnlDescription.TabIndex = 47;
-			// 
-			// grpDescription
-			// 
-			this.grpDescription.Controls.Add(this.lblDescription);
-			this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.grpDescription.Location = new System.Drawing.Point(0, 0);
-			this.grpDescription.Name = "grpDescription";
-			this.grpDescription.Size = new System.Drawing.Size(512, 80);
-			this.grpDescription.TabIndex = 0;
-			this.grpDescription.TabStop = false;
-			this.grpDescription.Text = "Description";
-			// 
-			// lblDescription
-			// 
-			this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.lblDescription.Location = new System.Drawing.Point(3, 16);
-			this.lblDescription.Name = "lblDescription";
-			this.lblDescription.Size = new System.Drawing.Size(506, 61);
-			this.lblDescription.TabIndex = 1;
-			this.lblDescription.Text = "Use this panel to select resources and to specify the time period for patient rem" +
-				"inder letters.  Check each resource (clinic) for which to print letters.  Letter" +
-				"s will be printed for appointments between the beginning and ending dates, inclu" +
-				"sive.";
-			// 
-			// lstResource
-			// 
-			this.lstResource.HorizontalScrollbar = true;
-			this.lstResource.Location = new System.Drawing.Point(24, 96);
-			this.lstResource.MultiColumn = true;
-			this.lstResource.Name = "lstResource";
-			this.lstResource.Size = new System.Drawing.Size(448, 124);
-			this.lstResource.TabIndex = 48;
-			// 
-			// cboResourceGroup
-			// 
-			this.cboResourceGroup.Location = new System.Drawing.Point(24, 40);
-			this.cboResourceGroup.Name = "cboResourceGroup";
-			this.cboResourceGroup.Size = new System.Drawing.Size(448, 21);
-			this.cboResourceGroup.TabIndex = 49;
-			this.cboResourceGroup.SelectedIndexChanged += new System.EventHandler(this.cboResourceGroup_SelectedIndexChanged);
-			// 
-			// label1
-			// 
-			this.label1.Location = new System.Drawing.Point(24, 16);
-			this.label1.Name = "label1";
-			this.label1.Size = new System.Drawing.Size(208, 16);
-			this.label1.TabIndex = 50;
-			this.label1.Text = "Resource Group:";
-			// 
-			// label2
-			// 
-			this.label2.Location = new System.Drawing.Point(24, 72);
-			this.label2.Name = "label2";
-			this.label2.Size = new System.Drawing.Size(72, 16);
-			this.label2.TabIndex = 51;
-			this.label2.Text = "Resource:";
-			// 
-			// dtBegin
-			// 
-			this.dtBegin.Location = new System.Drawing.Point(24, 312);
-			this.dtBegin.Name = "dtBegin";
-			this.dtBegin.TabIndex = 52;
-			// 
-			// dtEnd
-			// 
-			this.dtEnd.Location = new System.Drawing.Point(280, 312);
-			this.dtEnd.Name = "dtEnd";
-			this.dtEnd.Size = new System.Drawing.Size(192, 20);
-			this.dtEnd.TabIndex = 52;
-			// 
-			// lblRange
-			// 
-			this.lblRange.Location = new System.Drawing.Point(24, 272);
-			this.lblRange.Name = "lblRange";
-			this.lblRange.Size = new System.Drawing.Size(192, 16);
-			this.lblRange.TabIndex = 53;
-			this.lblRange.Text = "Date range for appointment letters:";
-			// 
-			// label4
-			// 
-			this.label4.Location = new System.Drawing.Point(24, 296);
-			this.label4.Name = "label4";
-			this.label4.Size = new System.Drawing.Size(152, 16);
-			this.label4.TabIndex = 54;
-			this.label4.Text = "Beginning Date:";
-			// 
-			// label5
-			// 
-			this.label5.Location = new System.Drawing.Point(280, 296);
-			this.label5.Name = "label5";
-			this.label5.Size = new System.Drawing.Size(152, 16);
-			this.label5.TabIndex = 54;
-			this.label5.Text = "Ending  Date:";
-			// 
-			// chkSelectAll
-			// 
-			this.chkSelectAll.Location = new System.Drawing.Point(32, 232);
-			this.chkSelectAll.Name = "chkSelectAll";
-			this.chkSelectAll.Size = new System.Drawing.Size(168, 24);
-			this.chkSelectAll.TabIndex = 55;
-			this.chkSelectAll.Text = "Select All Resources";
-			this.chkSelectAll.CheckedChanged += new System.EventHandler(this.chkSelectAll_CheckedChanged);
-			// 
-			// DSelectLetterClinics
-			// 
-			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-			this.ClientSize = new System.Drawing.Size(512, 470);
-			this.Controls.Add(this.chkSelectAll);
-			this.Controls.Add(this.label4);
-			this.Controls.Add(this.lblRange);
-			this.Controls.Add(this.dtBegin);
-			this.Controls.Add(this.label2);
-			this.Controls.Add(this.label1);
-			this.Controls.Add(this.cboResourceGroup);
-			this.Controls.Add(this.lstResource);
-			this.Controls.Add(this.pnlDescription);
-			this.Controls.Add(this.pnlOkCancel);
-			this.Controls.Add(this.dtEnd);
-			this.Controls.Add(this.label5);
-			this.Name = "DSelectLetterClinics";
-			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
-			this.Text = "Print Apppointment Letters";
-			this.pnlOkCancel.ResumeLayout(false);
-			this.pnlDescription.ResumeLayout(false);
-			this.grpDescription.ResumeLayout(false);
-			this.ResumeLayout(false);
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DSelectLetterClinics));
+            this.pnlOkCancel = new System.Windows.Forms.Panel();
+            this.cmdCancel = new System.Windows.Forms.Button();
+            this.cmdOK = new System.Windows.Forms.Button();
+            this.pnlDescription = new System.Windows.Forms.Panel();
+            this.grpDescription = new System.Windows.Forms.GroupBox();
+            this.lblDescription = new System.Windows.Forms.Label();
+            this.lstResource = new System.Windows.Forms.CheckedListBox();
+            this.cboResourceGroup = new System.Windows.Forms.ComboBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.dtBegin = new System.Windows.Forms.DateTimePicker();
+            this.dtEnd = new System.Windows.Forms.DateTimePicker();
+            this.lblRange = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.chkSelectAll = new System.Windows.Forms.CheckBox();
+            this.pnlOkCancel.SuspendLayout();
+            this.pnlDescription.SuspendLayout();
+            this.grpDescription.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pnlOkCancel
+            // 
+            this.pnlOkCancel.Controls.Add(this.cmdCancel);
+            this.pnlOkCancel.Controls.Add(this.cmdOK);
+            this.pnlOkCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlOkCancel.Location = new System.Drawing.Point(0, 430);
+            this.pnlOkCancel.Name = "pnlOkCancel";
+            this.pnlOkCancel.Size = new System.Drawing.Size(512, 40);
+            this.pnlOkCancel.TabIndex = 4;
+            // 
+            // cmdCancel
+            // 
+            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.cmdCancel.Location = new System.Drawing.Point(416, 8);
+            this.cmdCancel.Name = "cmdCancel";
+            this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+            this.cmdCancel.TabIndex = 1;
+            this.cmdCancel.Text = "Cancel";
+            // 
+            // cmdOK
+            // 
+            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdOK.Location = new System.Drawing.Point(336, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new System.Drawing.Size(64, 24);
+            this.cmdOK.TabIndex = 0;
+            this.cmdOK.Text = "OK";
+            // 
+            // pnlDescription
+            // 
+            this.pnlDescription.Controls.Add(this.grpDescription);
+            this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescription.Location = new System.Drawing.Point(0, 350);
+            this.pnlDescription.Name = "pnlDescription";
+            this.pnlDescription.Size = new System.Drawing.Size(512, 80);
+            this.pnlDescription.TabIndex = 47;
+            // 
+            // grpDescription
+            // 
+            this.grpDescription.Controls.Add(this.lblDescription);
+            this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescription.Location = new System.Drawing.Point(0, 0);
+            this.grpDescription.Name = "grpDescription";
+            this.grpDescription.Size = new System.Drawing.Size(512, 80);
+            this.grpDescription.TabIndex = 0;
+            this.grpDescription.TabStop = false;
+            this.grpDescription.Text = "Description";
+            // 
+            // lblDescription
+            // 
+            this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescription.Location = new System.Drawing.Point(3, 16);
+            this.lblDescription.Name = "lblDescription";
+            this.lblDescription.Size = new System.Drawing.Size(506, 61);
+            this.lblDescription.TabIndex = 1;
+            this.lblDescription.Text = resources.GetString("lblDescription.Text");
+            // 
+            // lstResource
+            // 
+            this.lstResource.HorizontalScrollbar = true;
+            this.lstResource.Location = new System.Drawing.Point(24, 96);
+            this.lstResource.MultiColumn = true;
+            this.lstResource.Name = "lstResource";
+            this.lstResource.Size = new System.Drawing.Size(448, 124);
+            this.lstResource.TabIndex = 48;
+            // 
+            // cboResourceGroup
+            // 
+            this.cboResourceGroup.Location = new System.Drawing.Point(24, 40);
+            this.cboResourceGroup.Name = "cboResourceGroup";
+            this.cboResourceGroup.Size = new System.Drawing.Size(448, 21);
+            this.cboResourceGroup.TabIndex = 49;
+            this.cboResourceGroup.SelectedIndexChanged += new System.EventHandler(this.cboResourceGroup_SelectedIndexChanged);
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(24, 16);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(208, 16);
+            this.label1.TabIndex = 50;
+            this.label1.Text = "Resource Group:";
+            // 
+            // label2
+            // 
+            this.label2.Location = new System.Drawing.Point(24, 72);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(72, 16);
+            this.label2.TabIndex = 51;
+            this.label2.Text = "Resource:";
+            // 
+            // dtBegin
+            // 
+            this.dtBegin.Location = new System.Drawing.Point(24, 312);
+            this.dtBegin.Name = "dtBegin";
+            this.dtBegin.Size = new System.Drawing.Size(200, 20);
+            this.dtBegin.TabIndex = 52;
+            // 
+            // dtEnd
+            // 
+            this.dtEnd.Location = new System.Drawing.Point(280, 312);
+            this.dtEnd.Name = "dtEnd";
+            this.dtEnd.Size = new System.Drawing.Size(192, 20);
+            this.dtEnd.TabIndex = 52;
+            // 
+            // lblRange
+            // 
+            this.lblRange.Location = new System.Drawing.Point(24, 272);
+            this.lblRange.Name = "lblRange";
+            this.lblRange.Size = new System.Drawing.Size(192, 16);
+            this.lblRange.TabIndex = 53;
+            this.lblRange.Text = "Date range for appointment letters:";
+            // 
+            // label4
+            // 
+            this.label4.Location = new System.Drawing.Point(24, 296);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(152, 16);
+            this.label4.TabIndex = 54;
+            this.label4.Text = "Beginning Date:";
+            // 
+            // label5
+            // 
+            this.label5.Location = new System.Drawing.Point(280, 296);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(152, 16);
+            this.label5.TabIndex = 54;
+            this.label5.Text = "Ending  Date:";
+            // 
+            // chkSelectAll
+            // 
+            this.chkSelectAll.Location = new System.Drawing.Point(32, 232);
+            this.chkSelectAll.Name = "chkSelectAll";
+            this.chkSelectAll.Size = new System.Drawing.Size(168, 24);
+            this.chkSelectAll.TabIndex = 55;
+            this.chkSelectAll.Text = "Select &All Resources";
+            this.chkSelectAll.CheckedChanged += new System.EventHandler(this.chkSelectAll_CheckedChanged);
+            // 
+            // DSelectLetterClinics
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(512, 470);
+            this.Controls.Add(this.chkSelectAll);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.lblRange);
+            this.Controls.Add(this.dtBegin);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.cboResourceGroup);
+            this.Controls.Add(this.lstResource);
+            this.Controls.Add(this.pnlDescription);
+            this.Controls.Add(this.pnlOkCancel);
+            this.Controls.Add(this.dtEnd);
+            this.Controls.Add(this.label5);
+            this.Name = "DSelectLetterClinics";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Print Apppointment Letters";
+            this.pnlOkCancel.ResumeLayout(false);
+            this.pnlDescription.ResumeLayout(false);
+            this.grpDescription.ResumeLayout(false);
+            this.ResumeLayout(false);
 
 		}
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/DSelectLetterClinics.resx
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/DSelectLetterClinics.resx	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/DSelectLetterClinics.resx	(revision 788)
@@ -4,5 +4,5 @@
     Microsoft ResX Schema 
     
-    Version 1.3
+    Version 2.0
     
     The primary goals of this format is to allow a simple XML format 
@@ -15,14 +15,15 @@
     ... ado.net/XML headers & schema ...
     <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">1.3</resheader>
+    <resheader name="version">2.0</resheader>
     <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
     <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1">this is my long string</data>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
     <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
     <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        [base64 mime encoded serialized .NET Framework object]
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
     </data>
     <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
     </data>
                 
@@ -36,5 +37,5 @@
     mimetype set.
     
-    The mimetype is used forserialized objects, and tells the 
+    The mimetype is used for serialized objects, and tells the 
     ResXResourceReader how to depersist the object. This is currently not 
     extensible. For a given mimetype the value must be set accordingly:
@@ -46,5 +47,5 @@
     mimetype: application/x-microsoft.net.object.binary.base64
     value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
@@ -60,7 +61,25 @@
     -->
   <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
     <xsd:element name="root" msdata:IsDataSet="true">
       <xsd:complexType>
         <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
           <xsd:element name="data">
             <xsd:complexType>
@@ -69,7 +88,8 @@
                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
@@ -90,212 +110,14 @@
   </resheader>
   <resheader name="version">
-    <value>1.3</value>
+    <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <data name="pnlOkCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="pnlOkCancel.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="pnlOkCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="pnlOkCancel.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>8, 8</value>
-  </data>
-  <data name="pnlOkCancel.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="pnlOkCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>8, 8</value>
-  </data>
-  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="grpDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="grpDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>8, 8</value>
-  </data>
-  <data name="grpDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="grpDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="grpDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="grpDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lblDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lstResource.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lstResource.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lstResource.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cboResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="cboResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="cboResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="dtBegin.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="dtBegin.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="dtBegin.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="dtEnd.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="dtEnd.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="dtEnd.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lblRange.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="lblRange.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="lblRange.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label5.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="label5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="label5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="chkSelectAll.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="chkSelectAll.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="chkSelectAll.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
-  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>(Default)</value>
-  </data>
-  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </data>
-  <data name="$this.Name">
-    <value>DSelectLetterClinics</value>
-  </data>
-  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>8, 8</value>
-  </data>
-  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>80</value>
-  </data>
-  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </data>
-  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
+  <data name="lblDescription.Text" xml:space="preserve">
+    <value>Use this panel to select resources and to specify the time period for patient reminder letters.  Check each resource (clinic) for which to print letters.  Letters will be printed for appointments between the beginning and ending dates, inclusive.</value>
   </data>
 </root>
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs	(revision 779)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs	(revision 788)
@@ -21,8 +21,11 @@
         /// <param name="e">PrintPageEventArgs from PrintDocument Print handler</param>
         /// <param name="beg">Begin Datetime to print appointments</param>
-        /// <param name="end">End Datetime to print appointments</param>
+        /// <param name="end">End Datetime to print appointments</param
+        /// <param name="resourceToPrint">The resouce to print</param>
+        /// <param name="apptPrinting">Current Appointment printing</param>
+        /// <param name="pageNumber">Current page number</param>
         /// <remarks>beg and end have no effect on operation--they are there for documentation for user only</remarks>
         public static void PrintAppointments(dsPatientApptDisplay2 ds, PrintPageEventArgs e, DateTime beg, DateTime end,
-            int resourceToPrint, ref int apptPrinted)
+            int resourceToPrint, ref int apptPrinting, int pageNumber)
         {
             Graphics g = e.Graphics;
@@ -40,11 +43,19 @@
             sf.Alignment = StringAlignment.Center;
             
+            //Header
             g.DrawString("Confidential Patient Information", f8, Brushes.Black, e.PageBounds, sf);
             
+            //Footer
+            sf.Alignment = StringAlignment.Center;
+            sf.LineAlignment = StringAlignment.Far;
+            g.DrawString("Page " + pageNumber, f8, Brushes.Black, e.PageBounds, sf);
+
             //Typical manipulable print area
             Rectangle printArea = e.MarginBounds;
             
+            //resource we want to print
             dsPatientApptDisplay2.BSDXResourceRow r = ds.BSDXResource[resourceToPrint];
             
+            //header
             string toprint;
             if (beg == end) toprint = "Appointments for " + r.RESOURCE_NAME + " on " + beg.ToLongDateString();
@@ -53,27 +64,152 @@
             g.DrawString(toprint, f14bold, Brushes.Black, printArea);
             
+            //Move print area down
+            printArea.Height -= (int)f14bold.GetHeight();
             printArea.Y += (int)f14bold.GetHeight();
+
+            //Draw Line
             g.DrawLine(new Pen(Brushes.Black, 0), printArea.X, printArea.Y, printArea.X + printArea.Width, printArea.Y);
-            printArea.Y += 5;
-            
-            System.Data.DataRow[] appts = r.GetChildRows(ds.Relations[0]); //only one relation
-
-            toprint = "";
-            StringFormat sf2 = new StringFormat();
-            sf2.SetTabStops(50, new float[] { 100, 200, 200 });
-
-            foreach (dsPatientApptDisplay2.PatientApptsRow a in appts)
+            
+            //Move print area down
+            printArea.Y += 5; 
+            printArea.Height -= 5;
+            
+            System.Data.DataRow[] appts = r.GetChildRows(ds.Relations[0]); //ds has only one relation 
+
+            StringFormat sf2 = new StringFormat();                 //sf to hold tab stops
+            sf2.SetTabStops(50, new float[] { 100, 250, 25 });     
+
+            //appt printed starts at zero
+            while (apptPrinting < appts.Length)
             {
-                toprint += a.ApptDate.ToString() + "\t" + a.Name +"(" + a.Sex + ")" + "\t" + "DOB: " + a.DOB.ToString("dd-MMM-yyyy") + "\t" + "ID: " + a.HRN;
-                toprint += "\n";
-                toprint += "Home Phone: " + a.HOMEPHONE + "\t" + "Address: " + a.STREET + ", " + a.CITY + ", " + a.STATE + " " + a.ZIP;
-                toprint += "\n";
-                toprint += "Note: " + a.NOTE;
-                toprint += "\n";
-                toprint += "Appointment made by " + a.APPT_MADE_BY + " on " + a.DATE_APPT_MADE;
-                toprint += "\n\n";
+                dsPatientApptDisplay2.PatientApptsRow a = (dsPatientApptDisplay2.PatientApptsRow)appts[apptPrinting];
+                
+                StringBuilder apptPrintStr = new StringBuilder(200); 
+                apptPrintStr.AppendLine(a.ApptDate.ToString() + "\t" + a.Name + "(" + a.Sex + ")" + "\t" + "DOB: " + a.DOB.ToString("dd-MMM-yyyy") + "\t" + "ID: " + a.HRN);
+                apptPrintStr.AppendLine("P: " + a.HOMEPHONE + "\t" + "Address: " + a.STREET + ", " + a.CITY + ", " + a.STATE + " " + a.ZIP);
+                apptPrintStr.AppendLine("Note: " + a.NOTE);
+                apptPrintStr.AppendLine("Appointment made by " + a.APPT_MADE_BY + " on " + a.DATE_APPT_MADE);
+
+                int printedApptHeight = (int)g.MeasureString(apptPrintStr.ToString(), f10, printArea.Width).Height;
+                if (printedApptHeight > printArea.Height) // too much to print -- move to next page
+                    // but don't increment the appointment to print since we haven't printed it yet.
+                    // i.e. apptPrinting stays the same.
+                {
+                    e.HasMorePages = true;
+                    break;
+                }
+   
+                //otherwise print it
+                g.DrawString(apptPrintStr.ToString(), f10, Brushes.Black, printArea, sf2);
+                
+                //Move print area down
+                printArea.Y += printedApptHeight + 3;
+                printArea.Height -= printedApptHeight + 3;
+
+                //Draw a divider line
+                Point pt1 = new Point((int)(printArea.X + printArea.Width * 0.25), printArea.Y);
+                Point pt2 = new Point((int)(printArea.X + printArea.Width * 0.75), printArea.Y);
+                g.DrawLine(Pens.Gray, pt1, pt2);
+
+                //move down, again
+                printArea.Y += 3;
+                printArea.Height -= 3;
+
+                //go to the next appointment
+                apptPrinting++;
             }
-            g.DrawString(toprint, f10, Brushes.Black, printArea, sf2);
-        }
+        }
+
+        /// <summary>
+        /// Print Letter to be given or mailed to the patient
+        /// </summary>
+        /// <param name="ptrow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>
+        /// <param name="e">You know what that is</param>
+        /// <param name="letter">Contains letter string</param>
+        /// <param name="title">Title of the letter</param>
+        public static void PrintReminderLetter(dsPatientApptDisplay2.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)
+        {
+
+            Rectangle printArea = e.MarginBounds;
+            Graphics g = e.Graphics;
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center; //for title
+            Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title
+            Font fBody = new Font(FontFamily.GenericSerif, 12);
+            g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title
+
+            // move down
+            int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height;
+            printArea.Y += titleHeight;
+            printArea.Height -= titleHeight;
+            
+            // draw underline
+            g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
+            printArea.Y += 15;
+            printArea.Height -= 15;
+            
+            // write missive
+            g.DrawString(letter, fBody, Brushes.Black, printArea);
+
+            //print Address in lower left corner for windowed envolopes
+            printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
+            printArea.Height = (int)(e.MarginBounds.Height * 0.20);
+            sf.Alignment = StringAlignment.Near;
+            sf.LineAlignment = StringAlignment.Center;
+            StringBuilder address = new StringBuilder(100);
+            address.AppendLine(ptRow.Name);
+            address.AppendLine(ptRow.STREET);
+            address.AppendLine(ptRow.CITY + ", " + ptRow.STATE + " " + ptRow.ZIP);
+            g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf);
+        }
+
+        /// <summary>
+        /// Print Letter to be given or mailed to the patient
+        /// </summary>
+        /// <param name="ptrow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>
+        /// <param name="e">You know what that is</param>
+        /// <param name="letter">Contains letter string</param>
+        /// <param name="title">Title of the letter</param>
+        public static void PrintCancelLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)
+        {
+            Rectangle printArea = e.MarginBounds;
+            Graphics g = e.Graphics;
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center; //for title
+            Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title
+            Font fBody = new Font(FontFamily.GenericSerif, 12);
+            g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title
+
+            // move down
+            int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height;
+            printArea.Y += titleHeight;
+            printArea.Height -= titleHeight;
+
+            // draw underline
+            g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
+            printArea.Y += 15;
+            printArea.Height -= 15;
+
+            // write missive
+            g.DrawString(letter, fBody, Brushes.Black, printArea);
+
+            //print Address in lower left corner for windowed envolopes
+            printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
+            printArea.Height = (int)(e.MarginBounds.Height * 0.20);
+            sf.Alignment = StringAlignment.Near;
+            sf.LineAlignment = StringAlignment.Center;
+            StringBuilder address = new StringBuilder(100);
+            address.AppendLine(ptRow.Name);
+            address.AppendLine(ptRow.STREET);
+            address.AppendLine(ptRow.CITY + ", " + ptRow.STATE + " " + ptRow.ZIP);
+            g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf);
+        }
+
+        public static void PrintMessage(string msg, PrintPageEventArgs e)
+        {
+            e.Graphics.DrawString(msg, new Font(FontFamily.GenericSerif, 14),
+                Brushes.Black, e.MarginBounds);
+        }
+        
     }
 }
