473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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="SYSTEM" instead of userName="machine")
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\printer"
command. Then I made this printer default printer and printed test page
ok. Also I copied registry settings from HKEY_CURRENT_USER to
HKEY_USERS\.DEFAULT 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.PrintDocument
Dim strPrinterName As String
...
strPrinterName = MyPrinter.PrinterSettings.PrinterName()
'Checked the variable above in debug mode: contains correct printer name
MyRpt.PrintOptions.PrinterName = strPrinterName
MyRpt.PrintToPrinter(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******@hotmail.com

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

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

Similar topics

0
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...
1
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...
0
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...
5
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. ...
8
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...
2
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...
6
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...
4
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...
10
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.