Lightswitch direct print without user interaction

Home » Lightswitch » Lightswitch direct print without user interaction

Lightswitch direct print without user interaction

| Lightswitch | januari 30, 2013

A few months ago I was working on a LightSwitch project for a outlet store. To create the back-end of the store LightSwitch was perfect for the database design and the creation of screens, I was done within a week. But like every store there should be a point of sale… I was in doubt about use LightSwitch for this but I gave it a try here is my POS screen:

LightSwitch POS

Some features of this screen

  • Barcode scanner enabled (Coming soon)
  • Keyboard shortcuts
  • Direct printing
  • Can’t conform the sale without your password (Comming soon)

One of the biggest challenge was to send the Invoice Report or the ticket direct to a ticket printer without a user-initiated action or selecting a printer. I use the DevExpress Reports extension for all my reports so I asked DevExpress for some advice but after a few support tickets ;) here , here  and here. Thanks to there help I was able to print the ticket but it still has to be user initiated and there was that annoying popup to select a printer… 


  • Print without a user-initiated action
  • No “Select your printer” pop up
  • No preview of the report
  • Needs to be fast!


I couldn’t use the LightSwitch Devexpress reports for this so I started to think out of the box and created a windows console application and added my DevExpress reports there. When you start the console application its possible to add 3 parameters witch are mandatory. The first one is the Entity Id (Invoice.Id for example), the second is the reportname (rptInvoice) and the third one is the printer name. Here is a overview of the console project:

LightSwitch DirectPrinter

Now thanks to the AutomationFactory its possible to start a console application with parameters! Here is the code to start the direct print in LightSwitch:



  • OOB applications only due to the AutomationFactory
  • You have to install the console application on every client on the same location


About the author

Partner @ Firmware

6 Responses to "Lightswitch direct print without user interaction"

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd met *

De volgende HTML-tags en -attributen zijn toegestaan: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>