logo

Lightswitch direct print without user interaction

Home » Lightswitch » Lightswitch direct print without user interaction

Lightswitch direct print without user interaction

| Lightswitch | January 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… 

Requirements

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

Solution

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:

PrintMethod

Disadvantages

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

 

About the author

This author has yet to write their bio.

4 Responses to "Lightswitch direct print without user interaction"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Current day month ye@r *

 Vraag het ons LIVE
Powered by PureChat.com