?
Solved

Needs to print in the client printer

Posted on 2006-03-31
11
Medium Priority
?
325 Views
Last Modified: 2012-05-05
Hi,
The requirement is as follows
We have a web application in which we create reports and export it to  PDF and display it in the browser.
All works the problem here is we have a textbox in the webform in this textbox the client will enter a number say 5. Add when exporting the report to the pdf and display it in the browser we need to automatically print in the printer connected to the client's PC the report n number of times(if the user has entered 5 in the textbox then we need to print it 5 times).

can anyone provide me a solution to this problem or a point me to a URL that will help me find the solution.

The softwares used in
C#, Asp.net 1.1 and we are using the crystal reports available in Visual Studio 2003

Thanks in advance

venki
0
Comment
Question by:tovvenki
  • 5
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Ramesh Srinivas
ID: 16340629
Hi venk,

Are you printing the pdf or crystal report??

Anyway, this may help you: http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21777756.html

regards,

KS

0
 
LVL 21

Author Comment

by:tovvenki
ID: 16340682
Hi,
Thanks for the quick response, but I think this is from an windows form application. I need to do that from a web application.

regards
venki
0
 
LVL 11

Expert Comment

by:Ramesh Srinivas
ID: 16340711
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:Ramesh Srinivas
ID: 16340720
Damn, it's server-side only i think :S

Not sure if there is a way to by-pass the print dialog on client-side printing (using window.print;).

I will look into it...
0
 
LVL 11

Expert Comment

by:Ramesh Srinivas
ID: 16340745
Apparently this works, but not for pdfs :O

AxWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)
0
 
LVL 21

Author Comment

by:tovvenki
ID: 16340762
Hi thanks again,
i think this won't work as this prints by reading using a stringreader. what is want is I have a webform which has a input box and a print button. when the print button is pressed a crystal reports report will be genereated and exported into a PDF then the generated PDF needs to be printed in the printer in the client's PC the number of times specified by the user.

regards
Venki
0
 
LVL 11

Accepted Solution

by:
Ramesh Srinivas earned 2000 total points
ID: 16340787
Doesn't look like there is a way :(

There is no way to disable the prompt with JavaScript, so for Netscape and other browsers, users will have to see the dialog.  However, in some versions of Internet Explorer, a call to the ExecWB OLE method from a second browser object can be used to circumvent the print dialog (note: spaces have been added to OBJECT declarations to display the code properly in this article--you should remove the spaces to use the code):


function PrintWindow(){
if (navigator.appName == "Microsoft Internet Explorer") {
     var PrintCommand = '< O B J E C T ID="PrintCommandObject" WIDTH=0 HEIGHT=0 ';
PrintCommand += 'CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">';
     document.body.insertAdjacentHTML('beforeEnd', PrintCommand);
     PrintCommandObject.ExecWB(6, -1); PrintCommandObject.outerHTML = ""; }
else { window.print();} }

You can try the ExecWB method on the client-side and hope that it bypasses the print dialogue for your pdf document. But ofcourse it may only work for IE.

regards,

KS

0
 
LVL 21

Author Comment

by:tovvenki
ID: 16340820
Hi,
I will try this out and get back to you. In the mean time if you have other ideas please let me know it.

Thanks
venki
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question