.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Printing to a Zebra label printer 105SL

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :ASP.Net

I'm trying to print to a zebra printer ( label printer ) thru' ASP net, using


 but I get nothing printed.Frown

The same ZPL/text works fine with window apps using: SerialPort Class 

Any help would really be appreciated. Thank you.

View Complete Post

More Related Resource Links

Printing from ASP.NET to a network printer

I need to send documents to a network printer (\myserver\myprinter). I'm using the System.Printing classes to print, and it works fine when it's from a Windows Service, but from an ASP.NET app, it's only able to print to local printers, not network printers. The error I'm getting is "Printer Name is not valid" This is what I'm using to get the printer name: public string PrinterName{   using (LocalPrintServer server = new LocalPrintServer())   return server.GetPrintQueue(@"\\myserver\myprinter");} It works fine if I print to \myserver\myprinter from Notepad directly, just not from code.  I'm on .NET 4.0/VS2010 and using ASP.NET Development Server.

Printing to printer. Not the page but some specific text.



I do run System.net.Mail on my web pages to send email confirmations. For those who doesn´t have an email I would like to print the letter to a printer.

Below is my code to send a body to the email. It works great. How ever. Could I somehow add a function to my page so when customer has no email the page instead prints the code to our network printer?

Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString("    <center> <img src=cid:companylogo> </center><br><br> " & fornamn & " " & efternamn & " " & "<br><br> " & adressen & "<br><br> " & "" & postnummer & " " & "" & postorten & "<br><br><p><strong>Välkommen som medlem i XXXX! </strong></p><p><strong>Tack för din beställning!", System.Text.Encoding.UTF8, "text/html")

WPF Printing to Datacard printer with Magstrip encoding.


I am writing a new WPF application that creates some visual elements and then trying to print them on a datacard printer. I am successfully printing using the System.Printing classes in WPF as follows:


Dim Pd As PrintDialog = New PrintDialog()
Dim Ps = New LocalPrintServer()
Dim PrintQueue = New PrintQueue(Ps, "Datacard Printer")
Pd.PrintQueue = PrintQueue
Pd.PrintVisual(Me.Grid1, "Print Job 1")  'this prints out perfectly


The problem is that the Datacard printer has an SDK that you can use to write to the Magstrip on the back of the card.  I have a working example using the PrintPageEventArgs in System.Drawing.Printing but I cannot find any close matches for the WPF world.  Here is that code:


Private Sub PrintPage(ByVal se

printing 20'' X 6'' report in a regular inkjet printer


Dear Friends

how do I print  20''  X 6'' report in a regular inkjet  printer.

I know I  need to feed the 6'' side to the printer but what should be the printer settings ?

should I design each of the text field in "writingMode=tb-rl"..... when i do this I am facing problems with alignment of adjacent fields...they seem to get displayed in different parts of the report

also i have about 50 textboxes and 2 tables  in the report.

Kindly help

zebra printer- barcodes


how to print barcodes from asp.net.

i create a barcode and save it as image and open in aspx form.

when i am using javascript print, the scanneer does not recognize the barocode as barcode is unclear .

but same is working fine with windows application print.


Rahul M




Printing on dot matrix printer using ReportViewer


Hi all,
I'm developing a Windows application in C#. It generates reports using ReportViewer. These reports should be printed on a dot matrix printer. However, there is a problem.
The application runs on multiple computers connected in a local network, the dot matrix printer is connected to the network also. When the report is generated and the Print button from the toolstrip of the ReportViewer control is pressed, the default Print dialog appears. When the matrix printer is selected and Print is pressed, the application crashes showing the Windows error message.
However, there are some things I noticed:
1. The error appears only on some computers in the network. From the other computers, the printing on dot matrix printer from my application runs fine.
2. If I try to print the report on a laser printer (which is also a network printer), it runs fine.  
3. Printing on the dot matrix printer is succesful from other applications on these computers.
4. All computers have the same operating system (Win XP) and the same version of my application.
Could anyone give me advise on how to approach the problem? I cannot debug this one because I'm using the functionality of the ReportViewer control for printing and actually don't have any source code to debug Smile

Printing to a Card Printer (SP55) using C#


I was wondering if anyone has a viable, working solution for encoding text and printing to the Magnetic Tracks on a card through this printer?

I can print normal text to it all day long. However, sending encoded text to the printer for the Magnetic Stripe on the card, - I havent been very successful. The DataCard SDK sucks - Its old and the only examples are in VB6.0 and C++. I would think that a company like the DataCard group would have created an SDK for .Net.

Any help would be much appreciated.

Bluetooth Printing Guide using Windows Mobile Pocket Pc

FieldSoftware Products printing products use the Bluetooth "Serial Port Profile" (SPP). Unfortunately, there is no standard method to find your Bluetooth printer and begin printing... each device contains a Bluetooth stack/driver that determines the steps. There are two main stacks currently available... one from Microsoft and one from WIDCOMM/Broadcom. Below are step-by-step instructions for printing with the Microsoft and WIDCOMM stacks. Note that these may change for different versions of the Bluetooth stacks or for different manufacturers. Consult the documentation for your device for specific details on your device.

Identifying your device''s Bluetooth stack: There is no sure steps to identify a Bluetooth stack on a device. Below are steps for identifying current WIDCOMM and Microsoft stacks at the time this page is published. Note that these may not identify earlier or later versions of the same BT stacks.

What Do the Different Printer Options using Windows Mobile Pocket Pc

Select Printer Options:
bullet Printer: Select the printer to print to. Some printer selections work for a variety of printers, such as the "HP PCL" selection which prints to most Hewlett Packard DeskJet, LaserJet and compatible printers.
bullet Port: Select between Infrared, Bluetooth, Network printing and Serial (COM1-COM8). Most Windows CE devices only have Infrared and COM1 and need special attachments to use the other selections. USB printing and printing across an ActiveSync connection to a desktop printer is not supported.
NOTE: On many Pocket PC devices, you CANNOT use the serial and infrared ports at the same time. This means that if your device is connected to your desktop PC using the serial Sync cable, the Infrared port will not work. You must disconnect the serial connection to use Infrared printing.
bullet Color/Mono: Select Monochrome (Black & White) if your printer is not a color printer (or if you wish to print in mono). If your printer has color capabilities AND has a black ink capability, select "4-Color CMYK". If your printer cannot hold both color ink and black ink at the same time, select "3-Color CMY".
bullet Paper Size: Select paper size for use. You can choose "Custom" and then set special paper sizes in the "Custom Paper" Width and Height boxes. For printers that use "roll" paper, you can set a maximum paper height of 22 inches.

More Settings O

ASP.net Ajax TabContainer -- Printing All tabs



Can  anyone help me with this?. I want to print all the tabs in ajax tab container. The tab container has around 10 tabs. I dont want to goto each tab and print the page. Instead is there any way by which I can tweek the print.css file to print all the tabs at a single stretch?.  So that I will get all the contents of the tab in single print.  Is there any other way in which I can print all the tabs all together?.

Thanks in Advance...


Printing resource files



I have some resource files for localization and would like to print them. When I try to print them in Visual Studio (with File -> Print...) the button is disabled. Does anyone know how to print them? (Without copying each into word or excel)

Thanks and regards,

Print row count on Label



I have an SP that simply performs a COUNT(*) from a table. I'm am trying to print that number in an ASP Label. It works in Query analyzer but I cant wrap my head around how to display it in a label. Any guidance much appreciated. 

Thank you. 

Automatic Batch Printing in ReportViewer Remote Mode


Please help me, i have a properly working codes that is capable of the following:

1. Printing of Reports from ReportViewer without using the build-in print ICON in the actual ReportViewer. to view the working for the printing alone please click here.

2. Batch Printing by making a loop and placing a checkbox on the gridview where the needed paramerter (DataKeyNames ID) is retrieved then pass to the ReportViewer

This is my Code

foreach (GridViewRow row in GridView1.Rows)
            CheckBox chk = (CheckBox)row.FindControl("CheckBox2");
            if (chk.Checked)
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://TestServer/ReportServer");
                ReportViewer1.ServerReport.ReportPath = @"/Tavern/StudPaymentReport";
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                ReportParameter[] rptParams = new ReportParameter[1];

                rptParams[0] = new ReportParameter("ClientID", GridView1.DataKeys[row.RowIndex].Value.ToString());


Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


How to display a count of search results with keywords in a label?


Sorry for a basic post here; I am very new to VB!

I am currently building a search page, which includes a textbox and two drop-down lists, a search button, and a datagrid. If results are found and displayed, I would like a label to display:

(e.g.) "24 results found for 'blue sky clouds' "

...where the integer represents the results count, and the keywords and/or drop-down list selections are included in the string.

If no results are found I would like the label to display:

(e.g.) "No results were found that match your selection. Please try again"

I would also like the label to be invisible until a search occurs.

Thanks in advance!

Editor's Note: Healthy Printing


Why we use the paper we do.

Joshua Trupin

MSDN Magazine November 2006

Printing: Preview and Print from Your Windows Forms App with the .NET Printing Namespace


Printing is an integral part of every complete Windows-based application. Providing robust printing capabilities in these applications has often proved to be a tedious chore. Now, printing from Windows Forms with the .NET Framework means you must adopt a document-centric approach, resulting in cleaner and more manageable code. While the System.Windows.Forms namespace provides seamless integration with all the standard print dialogs (such as Print Preview, Page Setup, and Print), the System.Drawing.Printing namespace offers numerous classes for extensibility and customization. These classes, and how they provide access to printing capabilities, are covered here. Other useful techniques, such as printing in the background to allow the user to continue other tasks, is also explained.

Alex Calvo

MSDN Magazine February 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend