Solved

ColdFusion Print button to default to landscape

Posted on 2013-01-12
7
904 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:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 500 total points
ID: 38771400
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
ID: 38772480
It works with I.E. 8 but not 9.

Do you have any info on this?
0
 
LVL 15

Expert Comment

by:Gurpreet Singh Randhawa
ID: 38777180
No, But i will check if i can see how its not behaving proper in IE 9
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 15

Assisted Solution

by:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 500 total points
ID: 38777185
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
ID: 38778995
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:
Gurpreet Singh Randhawa earned 500 total points
ID: 38779770
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
ID: 38851027
Thanks myselfrandhawa!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
segregating a list into two lists 4 66
Coldfusion Mysql get data from two tables 3 78
Coldfusion : Unix Epoch Time 4 30
REReplaceNoCase help 1 18
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

19 Experts available now in Live!

Get 1:1 Help Now