Printing Lables at the Kiosk

Coordinator
May 27, 2009 at 11:00 PM

Austin Spooner has asked if it is possible to create a print label provider that would print at the kiosk instead of the location...

I've done some research and basically it would entail:

  1. changing the Print method of the IPrintLabel provider to include a ComputerSystem (kiosk) parameter (Since our CccevPrintLabel provider is the only implementation I think this is safe to change the contract -- what other changes should be made; ie what other things should be passed to the Print method?)
  2. changing the Controller's CheckInFamilyMember method signature to include a ComputerSystem (kiosk) parameter and call the new Print method (from step 1)
  3. changing the Controller's CheckInFamily method signature to include the ComputerSystem (kiosk) parameter and call the new CheckInFamilyMember signature. (from step 2)
  4. changing the btnConfirmContinue_Click event in the CheckInWizard.ascx.cs (line 1253) to include the ComputerSystem (kiosk) argument in the call the new Controller.CheckInFamily signature (from step 3).

A few questions arise:

  • How would one go about deciding where to actually print the labels?
  • Does each provider only work one way (location vs kiosk)?
  • Or does the application (ie, the Check-In Wizard) get configured by an admin to control this and then it calls the PrintLable provider appropriately? 
  • Also, does this mean every provider must then know how to print in both the location and at the kiosk?
  • Could a provider print something at the kiosk and then something different at the location?  (cool idea.)

 

Jun 4, 2009 at 12:11 AM

Nick,

We are going to need this as well prior to July when we go live. What is your development timetable? Is this something we should code or are you already on it? 

On one hand, I don't see us having labels print in the classroom at all. We would print and retrieve them right at the kiosk. On the other hand, I could see the classroom label being printed there rather than being carried by the family. I have to think about that a bit. It seems like the fastest process would be to go to the classroom, hand them the label with your child and walk away rather than having the teacher make sure the kid is in the right classroom, they have a label etc.

So, I guess what I should say is that our current plan is for the labels to be printed at the kiosk only. I would think that the configuration should be at the application level, so if someone wants to do it different they can setup classroom printing but use kiosk printing for certain situations when necessary. 

Joel

Developer
Jun 4, 2009 at 6:18 PM

If reporting services were used for printing labels then it is automatic. The Childrens Attendance Labels have a "Printer Name" parameter that has, among the list of printers, "Use Kiosk Default" and "Use Location Default".  I like this setup as it resolves the last item of being able to print one label at the kiosk and one label at the room.

I think each provider should support both the ability to print at the kiosk and the ability to print at the location, by the sounds of it it isn't that big of a deal to provide support for both.

Daniel

Coordinator
Jun 5, 2009 at 4:37 PM

Yea, I think if we were to offer at-kiosk printing, then a module setting would definitely be the way to go for configurability.  We'd probably include a boolean setting to expose it.  With this, and the increasing demand for RS labels, we'll probably have a bit of work on how we're doing printing (as Nick mentioned in the RS post, we're using some legacy code to handle all of that).

Coordinator
Jun 5, 2009 at 7:51 PM

> What is your development timetable? Is this something we should code or are you already on it? 

It's definitely not on our official working@Cccev timetable, but I'll talk it over with Jason to see if he has the old CCV code while you track down Arena's code.  Then we can figure out how and who get's it done.

Coordinator
Jun 18, 2009 at 5:33 PM

Once we make the changes to the CheckInBLL's Controller class, the IPrintLabel interface will look like this:

public interface IPrintLabel
{
    void Print(FamilyMember person, IEnumerable<Occurrence> occurrences, OccurrenceAttendance attendance, ComputerSystem kiosk);
}

Then you can create a new IPrintLabel provider which does something similar to the code Caleb posted here.  Specifically, if you look at line 3 of his code, the printer network path would be obtained from the Kiosk entity/object.  The report path parameter (line 4) could be obtained from the AttendanceType.

   1: Arena.Reporting.ReportPrintJob printJob = new Arena.Reporting.ReportPrintJob
   2: (
   3:     "\\computer\printerName",    /* printer network path */
   4:     "/Arena/CheckIn/MyLabelReport", /* report path */
   5:     1,         /* # of copies */
   6:     true,         /* landscape */
   7:     parameters,    /* report parameter(s) */
   8:     true,        /* true if this is a physically attached printer */
   9:     string.Empty    /* unique identifier for print job */
  10: );
  11:                     
  12: Arena.Reporting.ReportPrintJobCollection jobs = new Arena.Reporting.ReportPrintJobCollection();
  13: jobs.Add(printJob);
  14:  
  15: // Handles printing
  16: Arena.Reporting.ReportPrinter printer = new Arena.Reporting.ReportPrinter();
  17:  
  18: // Option #1 - This impersonates the ArenaReports user (or whatever user you have configured for RS in Arena)
  19: // when printing.  Arena uses impersonation here because we print from a background thread sometimes, and the
  20: // current logged in user info is not available on background threads.
  21: printer.PrintReports(jobs);
  22:  
  23: // Option #2 - If you don't want to impersonate, you can directly call this method passing in each individual parameter.
  24: // Note that you need to pass in the name of the default windows printer for the current machine.
  25: System.Drawing.Printing.PrintDocument doc = new System.Drawing.Printing.PrintDocument();
  26: string defaultPrinter = string.Empty;
  27: if (doc.PrinterSettings != null)
  28:     defaultPrinter = doc.PrinterSettings.PrinterName;
  29:  
  30: foreach (Arena.Reporting.ReportPrintJob job in jobs)
  31: {
  32:     printer.PrintReport(job.PrinterName, job.ReportPath, job.Copies, job.Landscape, job.Parameters, defaultPrinter);
  33: }

Does this makes sense to everyone?

Coordinator
Jul 1, 2009 at 4:11 PM

I know this is old news... but the new IPrintLabel provider and corresponding class changes was made on Jun 18 via change set 55025 :

/trunk/Arena/UserControls/Custom/Cccev/Checkin/CheckInWizard.ascx.cs
/trunk/Arena.Custom.Cccev.CheckIn/CheckInBLL.cs
/trunk/Arena.Custom.Cccev.CheckIn/Entity/CccevPrintLabel.cs
/trunk/Arena.Custom.Cccev.CheckIn/Entity/IPrintLabel.cs

Coordinator
Sep 16, 2009 at 4:11 PM

Just a quick follow-up to this:

Nick and I started working on the Reporting Services provider yesterday.  We've chosen to go with Daniel's idea of using the Attendance Label functionality built into Arena.  Our early version is currently grabbing a list of Attendance Labels based on the Attendance Type and iterating through them.  On each label, if the "UseDefaultPrinter" flag is set to "true", then we use the printer defined by the kiosk.  If it's set to "false", then the Location's printer is used.

Bear in mind that this is an early version, and hasn't been tested yet, but we feel like this is probably going to be the best solution.  We felt a module setting would couple the view too tightly.  We'll most likely be testing the new provider out next week and building an updated label in reporting services, along with merging in Daniel's bug fixes and room balancing code.