Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Printing A Document Selected From A Drop Down List

Reply
 
Old 06-11-2008   #1 (permalink)
Iain Wilson


 
 

Printing A Document Selected From A Drop Down List

Hi All

I am trying my hand at printing from a web page for the first time. I
have been asked to print what amounts to many pages of data in
response to a button click. The scenario is as follows.

1. The user will select a Product from a Drop Down List.
2. The user will press the print button
3. Based upon the product selected in the Drop Down List I need to
print data gathered
from 3 different data sources. In addition I need to print at
least 5 different documents
(2 Word Documents, 1 Spreadsheet and 2 pdf documents" to a printer
specified in
another drop down list.

Gathering the data I can do.
I have authority to use the printer using impersonateValidUser
I can stream a text file and put that to the printer using
Graphics.DrawString.

However, what I want to do is simply give the PrintDocument object a
Document
name (as per the example I have tried below) and for the full document
to be printed


PrintDocument _doc = new PrintDocument();
string LPrinterName = @"\\Dun-Server3\" +
ddlPrinter.SelectedItem.Text;
_doc.PrinterSettings.PrinterName = LPrinterName;
...........
_doc.DocumentName = @"\\Server1\Temp\Pdf Documents
\MyPdf1.pdf";
...........
_doc.PrintPage += new
PrintPageEventHandler(_doc_PrintPage);
_doc.Print();


Am I going along the correct lines or is there some other way to do
this.

Thanks in advance for any assistance offered.

Iain

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Multiple Items in a List Box are being selected .NET General
Adding Program to list of Selected programs Vista General
drop down list everywhere Vista performance & maintenance
Search unable to find Word documents when "Document" type selected Vista file management
First e-mail in list is selected at startup Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46