cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Print From Browser

Former Member
0 Kudos

I have a requirement to "automatically" print a particular report to the printer.

I know that there's a server side print capability provided. But this needs printer configuration on the server end.

But I would prefer to print to the "default" printer configured on user's desktop instead.

Is this possible?

I'm also aware, that CR XI provides a configurable print button on the report itself, but customer doesnt want to click on multiple buttons; to reduce steps and avoid confusion. They just want to click on 1 button, that will bring up the print dialog on user's desktop where user can go ahead and print.

Environment

Currently using CR XI Java Components and Jboss as app server. So the reports are accessed using a web browser.

Accepted Solutions (1)

Accepted Solutions (1)

ted_ueda
Employee
Employee
0 Kudos

Hello Amit,

There's not a specific API that would allow for client-side printing.

The DHTML viewer invokes a JavaScript on the DHTML viewer page to trigger the postback for the print request.

Last time I accomplished something similar to what you're trying to do, I viewed a report in the viewer, looked at the HTML source, found the JavaScript method being triggered by the print button, used [Charles|http://www.charlesproxy.com/] to find the argument required for that method. Then I coded the viewer to take up a 1x1 size space (so it's hidden), then coded a JavaScript to trigger that method when a link was clicked.

There's been some sample code kicking around, hopefully someone has a copy (I lost mine).

Sincerely,

Ted Ueda

Answers (2)

Answers (2)

former_member203619
Contributor
0 Kudos

Here's one sample. It doesn't set the viewer size to 1x1, but it does all the rest.

Shawn

Note: This was for version 11- the javascript method name may have changed - so just view a report in your current version - view the source, and you can check what the function name is.

Edited by: Shawn Penner on Jul 24, 2008 6:39 PM

Former Member
0 Kudos

Hello,

please see some possible workaround [here|http://www.javascript-page.com/printpage.html].