.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 on dot matrix printer using ReportViewer

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :Windows Application

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

View Complete Post

More Related Resource Links

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 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 a Zebra label printer 105SL


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.

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

Help printing .rdl reports using the asp ReportViewer control from a web page to the users client pr


I have developed a set of ssrs .rdl reports and am trying to display them from the reportviewer control embeded in my asp web page. The problem is that when I select the print icon on the reportviewer control I am prompted to install ms sql server. I need help here. What is the best way to print .rdl reports from the web page's embeded reportviewer control to the client's local network printer.





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

ReportViewer Print Error To Non-Default Printer



I am using the ReportViewer control on a Windows form.  After a report is rendered succesfully in the control, if I click on the Print button in the ReportViewer toolbar and print to a printer that is NOT the user's default printer, I receive the error "The handle is invalid."  It works fine anytime you print to the default printer.

I'm wondering if someone can tell me if there is a fix for this in any service packs, new releases, etc.  I am currently using SQL Server 2008 and Visual Studio 2008.

This same issue was mentioned at the bottom of the following thread, but it doesn't appear that anyone ever responded that it was ever fixed.  You would think this issue would be fixed after 4 years now.  http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/42e80277-b2c6-4a70-9ba2-e7b039d6ec26/




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,

Web Matrix + Windows Authentication


I'm curious if its possible to get windows auth working with asp.net webpages/webmatrix.

I've got it published to IIS with windows auth turned on and anonymous/forms/basic turned off.

I'm guessing the WebSecurity Helper probably won't work here but can you access User.Identity.Name etc?

Sorry for the newbie questions, I've only just started working with asp.net ^^,

Session problem with display of image in row of reportviewer


Hello techies...

I am new to this sql reporting service. But anyhow by surfing I am able to bind the report but i was stuck in image display.

Anyways, i also managed that. But the real problem is whenever i was keeping a image control in rdlc report i was having session prob. If i remove the image control then as usual report works fine.

Please suggest me some solution.... either for session problem or for image display. I am keeping the image name in database but for binding the rdlc report i am using a store procedure which return the path (static) concating with the image name(kept in database).

Hope to find a solution .....

(Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Re


 I am trying to use ReportViewer 9 in Visual Studio 8 but I get this error when I try to run the page:

The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

Please help if you can!


ReportViewer :: Failed to enable constraints. But my statement is valid!!

  • A
  • n error has occurred during report processing.
      • Exception has been thrown by the target of an invocation.
        • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    Why do I keep getting this error, even when not using any data on the report. When I run the query in SQL server I get a resultset. However when I try to render the report I get this error.


    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