.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

Printer Acess

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

HI all,

I am creating one activex control(user control)  and assign one text box to printer name.

but i am getting following error in the webform 


 <object id="myControl1" name="myControl1" classid="ActiveXDotNet.dll#ActiveXDotNet.myControl"

        width="288" height="200">

 <script type="text/javascript" language="javascript">

        document.getElementById("myControl1").UserText = "test"; this is working

        document.getElementById("myControl1").UserText1 = "bbbb"; here i am getting this error

mscorlib: Request for the permission of type 'System.Drawing.Printing.PrintingPermission, System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.



        PrinterSettings prp = new PrinterSettings();

View Complete Post

More Related Resource Links

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

How to Acess VSS from a remote Computer


i acess vss from lan with no problems and now i want acess from a remote computer not in a Lan

I need access over the Internet

What are settings i need to set up in the server and my client machine

Infopath form services connectivity of printer



I am facing issue of printer connectivity from Infopath form services.

I have lines of code through which i can connect to printer using Infopath client mode.

I have shared the printer. Also the printer is set as default

The same lines of code is not working for browser enabled Infopath form.

Need help

Here is my lines of code. Is it there any credentials need to be passed ?



void btnSubmit_Clicked(object sender, ClickedEventArgs e)




Printer Friendly Page from a listview control


Hi guys,

I am working on a web form that displays the data from an access data source into a list view control. I need an advice on how to create , render a new page printer freindly .not buttons, controls,,, I have implemented a  java script function to select which records I want to view in the printable page but I cannot came up with any idea on how  to use this to create the printable help..


attempting to hook up my printer to dell inspiron 1440

I recently purchased a lexmark 5650 all in one printer. I attempted to setup my printer in which I was successful all the way up to the end nearly. It pops up a screen that says : Required Software Not Installed, Microsoft .NET Framework Version 2.0 is required to continue. This software is available for free download at http://www.microsoft.com/downloads/ . Well when I go there I picked the (x64) version which I thought was the right one for my computer, then it tells me my computer already has that program as part of the operating system So my question is; Can anyone help me figure out how to get this thing to work right? Thank you.

How to set printer orientation in VB.NET

Hi all,   i need to set the prineter orientation in VB.NET how to do this?   Is there any codes?Thanks!

Need help on setting printer orientation in VB.NET

Hi,   I try to change some printer settings using the win32 api OpenPrinter, GetPrinter and SetPrinter in VB.Net application.I copied most of the code from this or related newsgroups. However, OpenPrinter, GetPrinter and ClosePrinter works so far but I cannot change the printer settings. SetPrinter returns the error code ACCESS DENIED. I know I have to deal with the desired access mask in the _DEFAULT_PRINTER structure when calling OpenPrinter. Unfortunaltely the declaration of the DEFAULT_PRINTER structure or class I found on the internet doesn't work with the OpenPrinter function.       Public Structure DEVMODE         Public dmDeviceName As String         Dim dmSpecVersion As Short         Dim dmDriverVersion As Short         Dim dmSize As Short         Dim dmDriverExtra As Short         Dim dmFields As Integer         Dim dmOrientation As Short         Dim dmPaperSize As Short         Dim dmPaperLength As Short         Dim dmPaperWidth As Short         Dim dmScale As Short

snp file retains format of default printer from which it was created

This seems to be the case: MS Access 2000/2003 generates a snp report via VBA (Windows 2000/XP is the general environment for the enterprise).  The report is emailed to another individual.  When the recipient tries to print the report the print options apparently force the print job into the printer's override tray as "Print to Heavy Paper"; thereby causing the printer to wait for a user to place paper into the override tray (the printer is in use by a number of users). This anomaly does not happen with snp reports sent from other users, only from the two who are using one particular printer as their default printer.  As this relates to a remote customer, I have not so far requested the [affecting] sender users try using a different printer.  Either way it causes someone to perform extra steps -- Sender: if the printer selection was to be changed each time a snp report is created; Recipient: each time they need to print the particular report they need to go into printer options and override the Heavy Paper issue by selecting letter paper (and always be alert that the particular report came from the two particular sender users -- whereas once the recipient user sends the print job, it's too late; they need to run over to the printer to insert paper into the override tray to avoid a backlog of printer jobs). The site's IS team has bee

Printer Delivery Extension Error

I am trying to get the Printer Delivery Sample to work, and I have made all the changes, created the DLL, and changed the config files. It works if I am logged on to the server as the server admin, but if I try to run it from my workstation, I get this error, yet I am an admin on the SSRS system (I get the "Site Settings" link in the upper corner). SSRS is running under a domain account, and the printers are installed on the server under the same domain account. A subscription delivery error has occurred. (rsDeliveryError) One of the extension parameters is not valid for the following reason: Printer \\server\printer is not currently installed (rsInvalidExtensionParameter) Any thoughts why it works on the server, and not remotely? Thanks Rick 

Setting printer duplex programatically

How do you programmatcally set a printer to duplex?   The information I've found online indicates that GetPrinter/SetPrinter should do the trick, but so far I've had mixed results.    I'm automating Microsoft Word to print documents.  Some of the documents required to be duplexed.  So far in my research I've found the following web pages that provide somewhat helpful information. http://support.microsoft.com/default.aspx/kb/315720 How to enable and disable a printer by using the SetPrinter function in Visual C# http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q140/2/85.asp&NoWebContent=1 How To Modify Printer Settings by Using SetPrinter http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q167/3/45.asp&NoWebContent=1 How To Modify Printer Settings with the DocumentProperties() Function http://support.microsoft.com/kb/828638  How to set duplex printing for Microsoft Word Automation clients (This article appears to be starting pointing for the CodeProject article) http://www.codeproject.com/dotnet/NET_Printer_Library.asp  Changing printer settings using C# I've included the code I'm using now.  I don't get any errors and everything appears to work, but the Duplex setting on the printer is not set reliably.  My check is to open the printer's properties and the "Pr

Access Denied to backup but xp_cmdshell no Acess Denied

Hi, I'm trying to backup to a network drive, but I keep getting the message below: Cannot open backup device '\\Server\Projects\Exodus\Backup_Banco'. Operating system error 5(Access is denied.). The weird thing is that if I use xp_cmdshell on the same folder, I can dir, copy files, etc...  Why is that? Below is by backup command code that I get the Access Denied: BACKUP DATABASE Exodus TO DISK = '\\Server\Projects\Exodus\Backup_Banco' WITH COPY_ONLY, COMPRESSION, NOFORMAT, INIT And both xp_cmdshell commands below works without a glitch: exec xp_cmdshell 'dir \\Server\Projects\Exodus\Backup_Banco' exec xp_cmdshell 'copy \\Server\Projects\Exodus\Backup_Banco\text.txt \\Server\Projects\Exodus\Backup_Banco\text4.txt' Both SQL Server and SQL Agent are running on domain accounts, and I gave Modify rights on the \\Server\Projects\Exodus\Backup_Banco folder to the Domain Local Group that holds both accounts, as the copy commands shows. Both commands use SQL Server's service account rights, so I should get the same treatment for both commands. But that's not what is happening. Any ideas why? Thanks

how to print Test-page on default Printer ?

hi how to print Test-page on default Printer  using C# Winform Code ? thank's in advance

RsClientPrint add-on does not hold Default Printer Setting

 The default printer paper size is A4 in user PC but when the print icon is pressed in the report viewer control, the paper size is shown as Letter. Is there any way to capture the correct paper size as per the default printer?   Thanks,

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.

how to print "Hello World" to Default printer


how to print "Hello World" to Default printer ?

without crystalReport

in Winform C# program

thank's in advance

Send report to printer from code-behind...



I would like to create a print button to send a .rdlc report to the users printer. Since i'm not using report viewer to view my reports using it's controls is not an alternative.

I have a button that generates a .pdf file from the report, and now i would like to make a similar button, but to print the report.

Can anyone help me?

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