Use MicrosoftReportViewer and a Dymo LabelWriter to create a really nice and 3of9 barcode label

I have to say, I had fun coding this feature.  I wanted to print some 3of9 bar code labels for employee badges in a WinForms app I am rolling out. I was thinking this was going to involve some custom api and buying some font package (some are big $$). It turned out this was surprisingly simple and a fun report to build. Here is a sample label (extra points for first person to discover what is the barcode:

  image  

What you need:

  1. SqlServer or some other data source.  I am using Linq and Entity Framework. You could you XML, csv or memory objects as you need.
  2. Visual Studio and the MicrosoftReportViewer control. Not sure if this is included in Express addition or not. Let me know.
  3. A Dymo LabelWriter 400 or other such printer that can print single labels in a stream. I really like the Dymo for its ease of use, simple loading, and it is well made.  Also it is a thermal printer, so you don’t need to change any ribbons – ever.  About $100.  Order the label sizes you need – remember you need to order their special labels as they are thermal. I am using 3.5" x 1".  I also like this, because you don’t waste a lot of labels like trying to print 8.5"x11" sheets.  You always end up with half a sheet you don’t know what to do with.  So get a Dymo, you can use it for other things too.
  4. A 3of9 TrueType font. I use the Free3of9 ttfs here: http://www.squaregear.net/fonts/free3of9.shtml.  Hats off to Matthew Welch for his nice font package he is sharing!
    Just download and install the two fonts from the Control panel.

Steps to create the label report.  I am using 3.5" x 1" labels, but same steps apply for other sizes:

  1. Install the Free3of9 fonts and logout and back in to get the fonts loaded.
  2. Create a VS WinForms project. You could do the same with WPF, but I used WinForms.
  3. Add a new Form to hold your report control.
  4. Add a MicrosoftReportViewer control to the form. I have to give props to MS for this control. It is a great control that puts a lot of power in your hands.
  5. Create a new report from the drop down on the top right of the control.
  6. Once your in the designer, change the report properties Layout to 3.4in wide and .9in high.  I set it just a tad smaller then the label so as not to get strange page breaks.  Set all four margins to 0.
  7. Change the Body of the report surface to 3.4 x .9in or smaller. Just don’t make it larger then the page layout or you will get page breaks
  8. Now your surface is your "label".  Add your Table and other controls as needed for your label within this surface.
  9. Change the font family to 3of9 Extended for the field that you want to show as a barcode.
  10. Add as many Detail rows to your table as you need vertically.  I used 2 rows to show Employee name on top and EmployeeID as Barcode under it.
  11. Select the last row and right-click "Edit Group…" and group on some unique field such as employee id.  Also Check "Page break at end." so that your page will break to a new label after each employee.
  12. In the load event of the form, get your data as a list and set the DataSource property of the report control to the list and RefreshReport() after that.
  13. Run your report and adjust things as needed.  Fast, clean and professional barcodes in a snap right from your next windows application.

Misc:

  • Set the Dymo Advanced properties on the printer driver to "Barcodes and images" to get really clean quality. Set the Color to black and white, not sure why they have a Color option, but you can play with output as needed.
  • Can also use this same method to make a production receipt printer application with the Dymo with full graphics abilities.  Just get the Receipt paper they offer and change the report size.
  • Not sure how to make it print directly to a printer without user intervention yet.  Say you wanted a receipt to print after clicking a button and not show the print dialog.  If anyone knows how to make ReportViewer do this, please let me know.
  • Have fun with your new 3of9 labels!  I will try to add some pictures here and a sample project soon.
  • When I get my USB barcode scanner with Serial simulation driver, I hope to post back with some code showing how to use the Serial class so we can scan our new labels.

–William

About these ads
This entry was posted in Uncategorized. Bookmark the permalink.

7 Responses to Use MicrosoftReportViewer and a Dymo LabelWriter to create a really nice and 3of9 barcode label

  1. Unknown says:

    http://www.batteryfast.com/hp/dv2200.htm Hp dv2200 Battery http://www.batteryfast.com/hp/dv4000.htm Hp dv4000 Battery http://www.batteryfast.com/hp/dv6000.htm Hp dv6000 Battery http://www.batteryfast.com/ibm/thinkpad-t40.htm Ibm thinkpad t40 Battery http://www.batteryfast.com/toshiba/satellite-a105.htm Toshiba satellite a105 Battery http://www.batteryfast.com/toshiba/satellite-m45.htm Toshiba satellite m45 Battery http://www.batteryfast.com/toshiba/pa3285u-3bas.htm Toshiba pa3285u-3bas Battery http://www.batteryfast.com/toshiba/pa3395u-1brs.htm Toshiba pa3395u-1brs Battery http://www.batteryfast.com/toshiba/pa3399u-1bas.htm Toshiba pa3399u-1bas Battery http://www.batteryfast.com/toshiba/pa3399u-1brs.htm Toshiba pa3399u-1brs Battery http://www.batteryfast.com/toshiba/pa3399u-2bas.htm Toshiba pa3399u-2bas Battery http://www.batteryfast.com/toshiba/pa3399u-2brs.htm Toshiba pa3399u-2brs Battery http://www.batteryfast.com laptop battery http://www.batteryfast.com laptop batteries http://www.batteryfast.com/toshiba/pa3465u-1brs.htm Toshiba pa3465u-1brs Battery http://www.batteryfast.com/toshiba/pa3534u-1brs.htm Toshiba pa3534u-1brs Battery http://www.batteryfast.com/toshiba/pa3594u-1brs.htm Toshiba pa3594u-1brs Battery http://www.batteryfast.com/uniwill/255-3s4400-g1l1.htm Uniwill 255-3s4400-g1l1 Battery http://www.batteryfast.com/uniwill/258-4s4400-s1p1.htm Uniwill 258-4s4400-s1p1 Battery http://www.batteryfast.com/hp/pavilion-dv9000.htm HP pavilion dv9000 Battery http://www.batteryfast.com/hp/pavilion-dv9700.htm HP pavilion dv9700 Battery http://www.batteryfast.com/hp/pavilion-dv9500.htm HP pavilion dv9500 Battery http://www.batteryfast.com/hp/pavilion-dv9600.htm HP pavilion dv9600 Battery http://www.batteryfast.com/dell/inspiron-b130.htm Dell inspiron b130 Battery http://www.batteryfast.com/dell/inspiron-mini-9.htm Dell inspiron mini 9 Battery http://www.batteryfast.com/hp/nc8230.htm Hp nc8230 Battery http://www.batteryfast.com/hp/nc8430.htm Hp nc8430 Battery http://www.batteryfast.com/hp/nw8000.htm Hp nw8000 Battery http://www.batteryfast.com/hp/nw8200.htm Hp nw8200 Battery http://www.batteryfast.com/hp/nc6000.htm Hp nc6200 Battery http://www.batteryfast.com/hp/nc6100.htm Hp nc6100 Battery http://www.batteryfast.com/hp/nc6120.htm Hp nc6120 Battery http://www.batteryfast.com/hp/nc6400.htm Hp nc6400 Battery http://www.batteryfast.com/hp/pavilion-dv2000.htm Hp pavilion dv2000 Battery http://www.batteryfast.com/hp/pavilion-dv6000.htm Hp pavilion dv6000 Battery http://www.batteryfast.com/hp/pavilion-dv8000.htm Hp pavilion dv8000 Battery http://www.batteryfast.com/hp/pavilion-dv9000.htm Hp pavilion dv9000 Battery http://www.batteryfast.com/hp/pavilion-dv9500.htm Hp pavilion dv9500 Battery http://www.batteryfast.com/hp/pavilion-dv9600.htm Hp pavilion dv9600 Battery http://www.batteryfast.com/hp/pavilion-dv9700.htm Hp pavilion dv9700 Battery http://www.batteryfast.com/laptop-ac-adapter/acer/aspire-5520.htm Acer aspire 5520 Adapter http://www.batteryfast.com/laptop-ac-adapter/acer/aspire-5920.htm Acer aspire 5920 Adapter http://www.batteryfast.com/dell/kd476.htm Dell kd476 Battery http://www.batteryfast.com/dell/kr-onx511.htm Dell kr-onx511 Battery http://www.batteryfast.com/dell/latitude-d620.htm Dell latitude d620 Battery http://www.batteryfast.com/dell/latitude-d630.htm Dell latitude d630 Battery

Comments are closed.