473,700 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to print from the web server?

I am developing VB.Net Web application to be used in our department
intranet. I created a web-based report using Crystal Reports. I would
like to print the report from the web server instead of printing from
the browser because the latest will add additional text to the pages and
it also requires printing each page separately. In order to do this I
followed the steps described in article "Printing Web-Based Reports from
the Server", which suggested to change the <ProcessModel > tag in
machine.config file (userName="SYST EM" instead of userName="machi ne")
and also completed the steps described in related articles Q152451 and
Q184291: I added a local printer on server's LPT1 port and then attached
the network printer to lpt1 using "net use lpt1: \\server\printe r"
command. Then I made this printer default printer and printed test page
ok. Also I copied registry settings from HKEY_CURRENT_US ER to
HKEY_USERS\.DEF AULT as described in articles above.

During the report page Page_Load event the following code is executed:
Dim MyRpt As New Crystal1
Dim MyPrinter As New System.Drawing. Printing.PrintD ocument
Dim strPrinterName As String
...
strPrinterName = MyPrinter.Print erSettings.Prin terName()
'Checked the variable above in debug mode: contains correct printer name
MyRpt.PrintOpti ons.PrinterName = strPrinterName
MyRpt.PrintToPr inter(1, False, 0, 0)

When executing the last command got the error message with heading:
"Printers Folder" and text: "There was an error found when printing the
document "..." to LPT1:. Do you want to retry or cancel the job" with
Retry and Cancel buttons.
Before clicking on any of those buttons I opened the virtual Printers
directory of the web server and found the document in the Document List
queue with the status of "Error - Printing". After clicking on Cancel
the document disappears from the Document List.

Can somebody help?
se******@hotmai l.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
0 1099

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2242
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off after applying the filter. See the steps to recreate bug below for details.
1
5619
by: May | last post by:
is it possible to print a web page by using the PrintDocument class? The thing is that I need to print out some data in a nice format if possible, to a client's default printer. I got the printing part working. But I want to format the page first before it prints. I want to create a web page to gather all data in a table and print out the web page. So what I see is what the client gets. I don't know how to print a web page by using...
0
3252
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using PrintDocument.Print() (.NET framework v 1.1) I can print to a local printer plugged into LPT1 on the web server, but not to a network printer. The same printing code to a network printer works in a .NET web app when
5
1909
by: Tony | last post by:
Every 10 seconds I need to search a SQL table for orders to print. The orders are created through WebForms on ASP.NET clients. The orders should not print until 10 minutes before they are due. The network printer will be available from the server running IIS and SQL Server 2000. If this were a Windows Forms application, then I would create a system timer in Form1.Load(). How is this done in an ASP.NET application?
8
6386
by: jbonifacejr | last post by:
This is my first day here, so please be patient. I do not know how to search very well so the search I tried to get the answer showed me topics from the year 2000 and they really don't cover what I want. I am trying to open MSAccess from ASP..I guess I would use server.createobject("Access.Application") OK, but where do i go from there to run a report and have it print to the default printer?
2
22874
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the openning, fetching, and closing of a cursor. Things are fine if only one of the two parameters was set to 1. When run with both parameters turned on, "dba_test_dts 1, 1", DTS source (tab) preview fails because it thinks no row was returned....
6
9422
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate report" button located on my form to print all of the list box values (that have been updated via selection from combo boxes) from the form to the report. I've tried using a macro with the code: Macro Name: cmdGenerateReport : On Click Action:...
4
3538
Rabbit
by: Rabbit | last post by:
Here's my question. Does my connecting to the printer by IP affect the print server? The circumstances surrounding this question follows below. We have 16 network printers, most of them HP 4250n's, on a new print server that have intermittent corrupted prints. Every so often, a user will have a document that prints up to a certain point and the rest comes out garbled. And it does it on every printer and switching computers doesn't help. ...
10
8836
by: S_K | last post by:
Hi, I have a directory full of a number of .PDF files that I need to print. Is there any simple way to do this? Using PdfReader purhaps? Thanks in advance. Steve
18
4493
by: =?Utf-8?B?SGVyYg==?= | last post by:
I'm using a ReportViewer in ASP.NET. From the development environment it works fine. When published and I try to open the page with the ReportViewer I get the error: An internal error occurred on the report server. See the error log for more details. Do I have something configured wrong? I do not knw where to find the error log to review it.
0
8712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8639
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9203
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8952
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7794
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4395
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2375
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.