Solved

ColdFusion Print button to default to landscape

Posted on 2013-01-12
7
901 Views
Last Modified: 2013-02-04
Please view my print button code below. I'm trying to default to landscape without success.

Is there another method via ColdFusion instead of windows.print to accomplish landscape?


<style type="text/css">
    @media print {
      .noprint {
        display: none;
        size:landscape
         }
    }
  </style>


<input type='button' value='Print'   class='noprint' onClick='window.print()' style='width: 50'>
0
Comment
Question by:DJPr0
  • 4
  • 3
7 Comments
 
LVL 15

Assisted Solution

by:myselfrandhawa
myselfrandhawa earned 500 total points
Comment Utility
try this:

Using landscape will ONLY work in Internet Explorer.

<style type="text/css" media="print">
.landScape
{
 width: 100%;
 height: 100%;
 margin: 0% 0% 0% 0%;
 filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=3);
}
.noPrint
{
     display: none;
}
</style>

<body class="landScape">
 <form id="Form1" method="post" runat="server">
  <!--  Markup -->

  <input type="button" class="noPrint" value="Print" onclick="JavaScript:window.print();" >
 </form>
</body>
0
 

Author Comment

by:DJPr0
Comment Utility
It works with I.E. 8 but not 9.

Do you have any info on this?
0
 
LVL 15

Expert Comment

by:myselfrandhawa
Comment Utility
No, But i will check if i can see how its not behaving proper in IE 9
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 15

Assisted Solution

by:myselfrandhawa
myselfrandhawa earned 500 total points
Comment Utility
try with different rotations using a check if LT 9

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
rotation=1 Content is rotated 90 degrees.

rotation=2 Content is rotated 180 degrees.

rotation=3 Content is rotated 270 degrees.

Might work?

you ca make a check in html file itself
0
 

Author Comment

by:DJPr0
Comment Utility
you can make a check in html file itself

Do you have the code to check the version of the browser?
0
 
LVL 15

Accepted Solution

by:
myselfrandhawa earned 500 total points
Comment Utility
check this post of mine:


http://randhawaworld.com/?p=33

You can use this custom Tag to detect Browser and using a cffif condition you can add different styles for the code

just add dump to see what values you are getting,
0
 

Author Closing Comment

by:DJPr0
Comment Utility
Thanks myselfrandhawa!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now