Resistant to change

My company have a web application which allowing user to print a data report via an ActiveX component in the past, and due to the change of requirement from uesr, I created a new .NET control hosted in this web page with the use of crystal report today, allowing them to print the report to the printer directly.

Technical speaking, the users should never notice the change and the new report is faster and the result is exactly what they want. However, they told me that they miss the old one... as they can select printer and number of copies (that's the basic printer dialog of the browser in fact) with the old ActiveX component.  Therefore, I add a <DIV> with several buttons pretending the old printer dialog... Is it a normal behavior.. or.. an example of "Resistant to change"? :S

Colt Kwong

Published Friday, August 13, 2004 1:25 AM by Colt
Filed under:

Comments

# re: Resistant to change

It's bad practice to bypass basic client dialogues. In fact, in the case of printing, the ability for the end-user to have control over printer settings (selection, copies, quality) is fundamental.

I don't know what your situation entails but, from what you describe, it would seem that you should use the normal practice: Javascript.

Text:
<a href="javascript:window.print()">Print</a>

Image:
<a href="javascript:window.print()"><img src="images/printer.gif"></a>

Button:
<input type="button" value="Print" onClick="window.print()">

If you do not want a little Print icon or text on the printed page, you can have the printable version's page initiate the command, using onLoad of the Body tag. Or you could have the icon open a separate window and do this there.

Page Load:
<body onLoad="window.print()">

I'm likely ignorant to the finer requirements of your project; does your web application need something more advanced? Alternatively, there's that old-fashioned browser printer button or File > Print.

ADVIZR

Thursday, August 12, 2004 4:19 PM by ADVIZR

# re: Resistant to change

1.
I just did a little search and should also note that you can accompish the Javascript print without displaying any icon or text on the printable by using frames (a small bar at the top, etc.) and referencing the frame. Or, display fully in a 100% frame but target a hidden frame.

theframe.Print()

Take note that older browsers need the frame to be focues first...
http://developer.irt.org/script/1478.htm
http://developer.irt.org/script/1525.htm


2.
Here's another way...
http://developer.irt.org/script/1132.htm

3.
Other Print script tips from MSDN...
http://msdn.microsoft.com/library/default.asp?URL=/library/en-us/dnscrpt/html/dhtmlprint.asp

Thursday, August 12, 2004 4:44 PM by ADVIZR

# re: Resistant to change

Thanks for your comment ADVIZR.

Actually, I do allow users to input the info as parameters to my custom control, and I had handled the fundamental settings already, and I also programmatically defined the settings base on their inputs on the page as well. ;)

Thursday, August 12, 2004 11:43 PM by Colt

# re: Resistant to change

No problem. -_^

Friday, August 13, 2004 2:36 AM by ADVIZR

Leave a Comment

(required) 
(required) 
(optional)
(required)