473,398 Members | 2,113 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,398 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?

Nov 22 '05 #1
3 5216
It sounds like you're on the right track. Essentially, to
print from the server you have the have the printer you
want to access configured for the user account that
ASP/Crystal uses - according to the KB articles you
referred to. It sounds like you just need a bit more
test/troubleshooting. I had to pull my hair out over it a
bit, also, but it finally worked just fine for all of the
printers configured on the server.

Hope that helped some.

-----Original Message-----
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 theweb 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 describedin 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 withheading: "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?

.

Nov 22 '05 #2
Thank you Alex,

The account which is used by ASP is ASPNET and it is local
account. Do you have any suggestions how to configure this
account in order to access network resourses?

Nick
-----Original Message-----
It sounds like you're on the right track. Essentially, toprint from the server you have the have the printer you
want to access configured for the user account that
ASP/Crystal uses - according to the KB articles you
referred to. It sounds like you just need a bit more
test/troubleshooting. I had to pull my hair out over it abit, also, but it finally worked just fine for all of the
printers configured on the server.

Hope that helped some.

-----Original Message-----
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 codeis executed:
Dim MyRpt As New Crystal1
Dim MyPrinter As New System.Drawing.Printing.PrintDocumentDim 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?

.

.

Nov 22 '05 #3
Thank you Alex,

The account which is used by ASP is ASPNET and it is local
account. Do you have any suggestions how to configure this
account in order to access network resourses?

Nick
-----Original Message-----
It sounds like you're on the right track. Essentially, toprint from the server you have the have the printer you
want to access configured for the user account that
ASP/Crystal uses - according to the KB articles you
referred to. It sounds like you just need a bit more
test/troubleshooting. I had to pull my hair out over it abit, also, but it finally worked just fine for all of the
printers configured on the server.

Hope that helped some.

-----Original Message-----
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 codeis executed:
Dim MyRpt As New Crystal1
Dim MyPrinter As New System.Drawing.Printing.PrintDocumentDim 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?

.

.

Nov 22 '05 #4

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
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,...

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.