views:

265

answers:

3

hi i have an asp .net site with a print option (onclick = window.print()) the problem is that when using IE 7 it gets fine on the page but when users using IE 6 print the page they get it larger than the page is

+1  A: 

It depends up on the default print settings set on client machine.

This has nothing to do with asp.net

Also, OnClick = Window.Print() is an javascript function which would be executable in client machine.

You can use the CSS to control the way the page needs to be printed/viewed.

@media print {
    BODY { font-size: 10pt }
  }
  @media screen {
    BODY { font-size: 12pt }
  }
  @media screen, print {
    BODY { line-height: 1.2 }
  }
Smart Pandian
A: 

and can i some how control so that i get the same result from all computers regardless of the IE version?

A: 

You cannot control the printing so you get the same result regardless of client, that's one of the "beauties" of HTML.

IE7 for instance introduced enhanced user-controlled printing options to "fix" some of the problems while printing web sites. This is still in the hands of the user though, and caters for their idea how the page in question would be best printed, and not really something the page itself or web developer can control.

If you need something for controlled print, use a suitable format instead - like PDF (generate it on the fly if needed).

Oskar Duveborn