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

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

Activex control to Print a Zebra Tag

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
Hi All, I'm trying to create an Activex control (similar to the Crystal Activex) to Print tag's from a Client side to a Com Port 1. I created a User control I can pass values to it etc, but It won't Print. Any Ideas? User Control Code:Imports System.Text Namespace Tag Public Interface AxMyControl Property UserText() As String End Interface 'AxMyControl Public Class myControl Inherits System.Windows.Forms.UserControl Implements AxMyControl Private mStr_UserText As String Public Property UserText() As String Implements AxMyControl.UserText Get Return mStr_UserText End Get Set(ByVal Value As String) mStr_UserText = Value TextBox1.Text = mStr_UserText Print() End Set End Property Public Function Print() As Boolean Dim tstr As New StringBuilder ' Printer Code tstr.Insert(0, "^XA") tstr.AppendLine("") tstr.Append("^LH5,30") tstr.AppendLine("") tstr.AppendLine("") tstr.Append("^FO75,110^BY1.5") tstr.AppendLine("") tstr.Append("^B3N,N,75,Y,N") t

View Complete Post

More Related Resource Links

Printing Landscape Report using the Print Control of the ASP.NET Report Viewer

I am using the ASP.NET Report Viewer 2010 web control in remote processing mode connected to a SQL Server Reporting Services 2008 R2 report server in Native Mode. I am viewing the report in IE8 and the print control within the report viewer is available. According to "Printing Reports from a Browser Using the Print Control" at http://msdn.microsoft.com/en-us/library/ms159237.aspx  "The Print dialog box and the default printer settings for width, height, and page orientation are determined by the report definition." In SQL Server Business Intelligence Development Studio I am using the “Report Properties” window accessed from the “Report” menu to set the Orientation to “Landscape”, the paper size to “Letter”, the Width to “11in”, and the Height to “8.5in” in the report definition. When viewing the report using the ASP.NET Report Viewer 2010 in IE8 and exportint to PDF, the report renders correctly in landscape orientation and the size both on screen and printed is as defined in the report definition. However, if I print it directly from the ASP.NET Report Viewer using the Print Control the print preview shows the report correctly in landscape orientation and page size, but the resulting printout is in portrait orientation and skewed or cropped.  If I go into the properti

Does the ReportViewer control print button work inside of a modal MSIE window?

I am getting the following two error messages when using the new ReportViewer v10 control after pressing the toolbar print button. I am only seeing this error inside of a modal popup window in MSIE. The print button in a normal popup window doesn't have this error. An error occurred trying to get the current window Error: Could not complete the operation due to error 8007f305. If anyone knows of a quick fix, please let me know. Thank you. VS2010, MSIE 8, SQL Server 2008.

Unable to load client print control

Hi friends,I am facing one problem since two days in ssrs 2008, i am not able to solve this problem, can any one help me please..Problem Statement:- I am getting "Unable to load client print control"  error when i am trying to give print option from report server.Looking forward for any one help in this problem.

Using ActiveX control in WPF

I'm attempting to host an ActiveX control in a WPF app. After attempting to use existing info on the web and here, I've hit a dead-end. I need to use an ActiveX control provided to communicate with a UV power meter . They provide an application that registers and uses the control and even includes some useful demo apps. I stripped out the OCX file and put it here if needed. You won't have the power meter to talk to, but the app and demos will still load the ActiveX control successfully. I created a simple Windows Forms application. I was able to bring the ActiveX control into the toolbar, drop it into my form, and everything is fine. The demo apps they provide do this as well. However, getting this to work in a WPF environment is another story. The control can't be added to the toolbox and "dragged" into the app. So far I've tried two techniques: Technique found here . I am able to add a reference to the control, but then I enter namespace ____. The xmlns:ax namespace it suggests making cannot find the information. Here's my attempt based on what the object viewer tells me: xmlns:ax="clr-namespace:OphirUsbXLib;assembly=Interop.OphirUsbXLib" Technique found here . This is essentially to create a new project that creates a library based on Windows Forms, which contains the ActiveX control (yikes). I am able to add the Windows Forms Host, but I canno

How to print a landscape by using PrintForm control in C# ?

How can I print a Windows form in a landscape format by using "PrintForm" control in C# ? "PrintForm.PrinterSettings.LandscapeAngle" is a returned value. Thanks  

Print control works on reporting server, but not in embedded in application

Hi,I am having an issue where if I click on the print icon in the report viewer embedded in an application, I get the error "unable to load client print control".  However, when running through report manager, this is fine.  I am running SQL Server 2005 SP3 and report viewer 9.Any thoughts would be much appreciated.

Unable to load client print control

When you display a SQL Reporting Services report to the screen in the header there is a Printer Icon displayed.  When we click this icon we get an error message "Unable to load client print control ". Does anyone know what we need to load or what we need to do to resolve this so that we can print the report directly to teh printer, rather than having ot prinnt the web page, which also prints all the Web headre information

ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current

Ok actually i m new to .net so you can tell me that i m right or wrong.   1. First of all i created a class library project in which i added a Windows Form (ModuleTest.cs) in this form i added a web browser control.This form is having on method. public void CheckModule(String username, String password, String modulename, List<CustumFields> objList)         {                  ----------------                  -----------------           }   then i build this whole library.(ClassLibrary.dll). 2. I created a web site in which i added ClassLibrary.dll reference.     then i placed on button control over the page protected void Button1_Click(object sender, EventArgs e)         {             ModuleTest obj = new ModuleTest();             List<CustumFields> objlist= new List<CustumFields>();             obj.CheckModule("admin", "adm1n1@3", "Testing102", objlist);     

ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current

I have created a class library in which i m having Web Forms.now when i use this dll in ASP.NET websiteand call methods            ModuleTest obj = new ModuleTest();            List<CustumFields> objlist= new List<CustumFields>();            obj.CheckModule("admin", "password", "Testing102", objlist);then it gives errorActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartmentthis.components = new System.ComponentModel.Container();            this.panel1 = new System.Windows.Forms.Panel();            this.webBrowser1 = new System.Windows.Forms.WebBrowser();            this.timer1 = new System.Windows.Forms.Timer(this.components);            this.SuspendLayout();this error occurs at this.webBrowser1 = new System.Windows.Forms.WebBrowser();when i mouse over webBrowser1 then it shows null....Whats the problem?

Report Viewer control: Print crashes if subreport is too long



I have a report and a .NET 3.5 Winforms application which displays the report in local mode, passing the required datasets to the report as it is supposed to do. It takes about 2 seconds before the report is displayed.

However, when I click on Print Layout, the "Loading..." box appears and does not disappear any more. If I want to print the report, a window appears telling me that the first page is being sent to the printer and... that's it, all I can do is kill my application via task manager.

After playing around with various elements in my report, I was able to reproduce this behaviour if one of my subreport returns too many rows (the subreport contains only a list element, listing all records).

I believe it has something to do with the subreport spanning more than one page. I played with the KeepTogether property on various elements, but to no avail. Has anybody experienced something like this before? Is there a workaround?



SQL Server 2008 SP2 Windows 7 UAC Prompt Print Control


We recently installed SQL Reporting Services SP2.  When we run Report Manager (i.e http://myserver/reports) and attempt to print a report using the Print control we get UAC prompts for both Vista and Windows 7.  This may not be relevant but if we click Show Information About this Publishers Certificate under UAC prompt it indicates the certificate expired on Feb 22, 2009.  Were the correct CAB files for installing the print control included in SP2?

Most of our clients are running Windows 7/Internet Explorer 8 and are fully patched.  Logged on users are members of local administrators group and the UAC settings are set to default settings.

If we right click IE 8 icon and then "Run As Administrator" we don't get the prompt.  My question is can the UAC prompt somehow be disabled if IE is started without using the "Run As Adminstrator" option and without turning off UAC?


Unable to load client print control


I have a user that had previously installed the client print control and had been printing reports. He used some kind of PC cleanup tool and got the new Norton Antivirus and now he can no longer print and is getting the "Unable to load client print" control whenever he is clicking on the printer icon. He doesn't see any other messages on the screen saying that an Active X control is trying to be installed but is being blocked. What are the next steps that I should take to help him?


Cannot call an ActiveX control from within a .NET WebBrowser control


I have a simple webpage that starts an ActiveX control. Here's the code:

<script language="JavaScript" type="text/javascript">
   try {
      document.write("<object classid='clsid:1D980DC8-9C45-11D3-9C5C-00A13234F0A2' id='myActiveX' name=' myActiveX'  width='0' height='0'></object>");
      var bReturn = myActiveX.StartControl();
   catch (e) {
      document.write('Failed<br>' + e.name + '<br>' + e.message);

This works well when I call this page directly from Internet Explorer on Windows XP, 7 & server 2003

I created a .NET form in Visual Studio, and added a .NET WebBrowser Control from the toolbox. I set the URL of the WebBrowser to call the same web page.

I complied it & ran the executable. This works well from Windows XP & server 2003, but fails in Windows 7. Here's the JavaScript error message:


ActiveX control replacement by silverlight technology



We developed an ActiveX plug-in for PowerPoint on Windows  The control allows content to be created in some graphical application, transferred to a PowerPoint presentation, and manipulated in 3D in PowerPoint in a view-only manner.  Graphical application is a scientific application which provides ability to create atoms, molecules, defining their bonding and defining surfaces, so user basically create molecules, proteins into the application and transfer it into ActiveX control using  copy-paste.

We want to shift this technology from ActiveX to other, so that it can be used by any software like Microsoft Word, SharePoint, Web browser, and Microsoft Excel.


Can someone tell me alternative of ActiveX? What other technologies can be used to develop same functionality in Microsoft domain? Any pointers indicating for Advantage and disadvantage of using ActiveX and other proposed technology?

I heard about Silverlight, but I do not know anything how it would be useful and how it is beneficial over ActiveX?

How to get Metadata of a ActiveX control on fly in C#?


I am facing problem in getting metadata(like properties,Events and methods) of a ActiveX controls on fly from a web page(using <OBJECT> tag and ActiveXObject or CreateObject), just by giving its ClassID or ProgramID using C# or C++.

Is there any standard way to get meta data of a activex control present in a web page using C# and C++?

Actually i am working for a product based company. The product on which i am working has a feature of Web automation, Currently our product has no capability of automating Activex controls present in a web page. We are enhacing our product to have this support.

i am doing research on this and stucked up at this point of getting meta data of a ActiveX control. I need meta data to know its list of attributes,methods and events, which will help in automating the activex control.

Help me in solving this issue, provide me if any sample code or examples avaialble Or  provide me links to refere.













Unable to load client print control


When trying to print a report, I get an error message Unable to load client print control.

I get this error when trying to print on all computers.

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