Microsoft KB Archive/311757

= PRB: Control Shape Is Distorted When You Print an ActiveX Control if You Use a Percent Value for the Height =

Article ID: 311757

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Internet Explorer 5.5
 * Microsoft Internet Explorer (Programming) 6.0

-



This article was previously published under Q311757



SYMPTOMS
When you print ActiveX controls in Internet Explorer or view the output in Print Preview, the output may appear elongated if the height is set as a percentage value. For example, a control that draws a circle may look like an ellipse when printed.



CAUSE
This behavior can occur because the aspect ratio is different for the screen and the page. Typically, there is a wide, short-screen viewport for the Internet Explorer window, and a tall, narrow viewport for the printed page. When you print, or view output in Print Preview, you invoke a percent value of the viewport of the page, not the screen. You would notice similar behavior if you were viewing a very tall Internet Explorer window (with no proportionate expansion of the width).

If you do not size the control to the viewport of the printed page, you have to continually resize your browser window until the document fits within your page or margin area.



RESOLUTION
To preserve the layout of your page when you print it, use a specific non-relative value instead of a percentage. If you want your control to occupy a certain percentage of the screen, you can calculate the appropriate height dynamically through code. For example, instead of setting the height in the OBJECT tag in the following manner  set the height from the onLoad event of the BODY tag, as follows:  



STATUS
This behavior is by design.



Steps to Reproduce the Problem
Use the following code to set the dimensions for the Calendar control:  

   Then, print the page. Note the behavior described in the &quot;Symptoms&quot; section of this article.

<div class="references_section">