Changeset 804 for Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs
- Timestamp:
- Jun 19, 2010, 12:41:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs
r789 r804 279 279 /// <summary> 280 280 /// Print message on a page; typically that there are no appointments to be found. 281 /// Or just a test message to verify that printing works. 281 282 /// </summary> 282 283 /// <param name="msg">The exact string to print.</param> … … 287 288 Brushes.Black, e.MarginBounds); 288 289 } 289 290 291 /// <summary> 292 /// Print Routing Slip 293 /// </summary> 294 /// <param name="a">Appointment Data Structure</param> 295 /// <param name="title">String to print for title</param> 296 /// <param name="e">etc</param> 297 public static void PrintRoutingSlip(CGAppointment a, string title, PrintPageEventArgs e) 298 { 299 Rectangle printArea = e.MarginBounds; 300 Graphics g = e.Graphics; 301 StringFormat sf = new StringFormat(); 302 sf.Alignment = StringAlignment.Center; //for title 303 Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title 304 Font fBody = new Font(FontFamily.GenericSerif, 18); 305 Font fBodyEm = new Font(FontFamily.GenericSerif, 18, FontStyle.Bold); 306 g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title 307 308 // move down 309 int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height; 310 printArea.Y += titleHeight; 311 printArea.Height -= titleHeight; 312 313 // draw underline 314 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 315 printArea.Y += 15; 316 printArea.Height -= 15; 317 318 //construct what to print 319 string toprint = "Patient: " + a.PatientName + "\t" + "ID: " + a.PatientID; 320 toprint += "\n\n"; 321 toprint += "Appointment Time: " + a.StartTime.ToLongDateString() + " " + a.StartTime.ToLongTimeString(); 322 toprint += "\n\n"; 323 toprint += "Notes:\n" + a.Note; 324 325 //print 326 g.DrawString(toprint, fBody, Brushes.Black, printArea); 327 328 // Print Date Printed 329 //sf to move to bottom center 330 StringFormat sf2 = new StringFormat(); 331 sf2.LineAlignment = StringAlignment.Far; 332 sf2.Alignment = StringAlignment.Center; 333 334 //Print 335 Font fFooter = new Font(FontFamily.GenericSerif, 8); 336 g.DrawString("Printed: " + DateTime.Now, fFooter, Brushes.Black, printArea, sf2); 337 338 } 290 339 } 291 340 }
Note:
See TracChangeset
for help on using the changeset viewer.