• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 806
  • Last Modified:

How to automatically print an asp web page in landscape

Hi All,

I wonder if anyone can help? I have a website setup in ASP.NET and one of the pages contains a report which internal users will need to print in landscape. When you select print, the default is to print in portrait. Is there a script or piece of code which can be used to allow the user to automatically print this page in landscape without having to change it themseleves within the print menu?

Many thanks,
Amy Downing
0
klwn
Asked:
klwn
  • 2
1 Solution
 
Ramkisan JagtapLead DeveloperCommented:
<head runat="server">
    <title>Default3</title>
<style type="text/css" media="print">
.noDisplay
{
}
.noPrint
{
     display: none;
}
.landScape
{
 width: 100%;
 height: 100%;
 margin: 0% 0% 0% 0%;
 filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=3);
}
.pageBreak
{
 page-break-before: always;
}
</style>
</head>
<body class="landScape">
    <form id="form1" runat="server">
    <div>
 This is some content to print
    </div>
    </form>
</body>
0
 
grayeCommented:
or just
@page {size: 8.5in 11in landscape}
0
 
klwnAuthor Commented:
This solution was a great help, thank you. We placed the code within the body of our stylesheet and this worked. We did however get the following error when hovering over the filter property - 'filter is not a known css property name' when using Visual Web Developer 2008 - Express Edition. After researching this error, we found that this is only an issue if you are using any other browser other than Internet Explorer. As our solution is for an internal intranet of which Internet Explorer is used, this isn't currently an issue for us.
0
 
klwnAuthor Commented:
Hi All,
We have an additional query to the above solution. Can the headers / footers be removed from the report as these are still printing in portrait? The body of the report is fine and printing in landscape as required.

Many thanks,
Amy Downing
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now