1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Bangalore
    Posts
    95
    Vote Rating
    1
    Rameshlamani is on a distinguished road

      0  

    Default How to make default landscape print using javascript/Extjs?

    How to make default landscape print using javascript/Extjs?


    I have done application using Extjs 4.1, have implemented print functionality by creating XTemplte opening in new window. Print is working very nicely. once i click print it will open by default in portrait mode, instead of this one how to open print in landscape mode by default? Great appreciated. Thank you.
    Here is my code:

    Code:
     if (Ext.isChrome) {
                    newWin= window.open();
                    newWin.document.write('<p style="color: #003366;font-weight:bold;font-size:30px; text-align: center">'+titleName+'</p>'+'<p style="color: #003366;font-weight:bold;font-size:10px; text-align: left">'+filterlblInfo+'</p>'+this.generateHTML(GridViewId));            
                    newWin.document.close();
                    newWin.focus();
                    newWin.print();
                    newWin.close();
                    newWin='';
                }
                else{
                    var win = window.open('', name);
                    win.document.write('<p style="color: #003366;font-weight:bold;font-size:30px; text-align: center">'+titleName+'Currency Type:'+currencyType+'</p>'+'<p style="color: #003366;font-weight:bold;font-size:10px; text-align: left">'+filterlblInfo+'</p>'+this.generateHTML(GridViewId));
                    setTimeout(function() {
                        win.document.close();
                        win.print();
                        win.close();
                    }, 1000);
                }

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    While ExtJS doesn't offer a way to manage the print layout itself, but there may be ways to do that. I came across these links on the subject:
    http://stackoverflow.com/questions/2...g-window-print
    http://stackoverflow.com/questions/1...ting-from-html


    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager:
    sheryl@sencha.com

  3. #3
    Sencha User
    Join Date
    May 2012
    Location
    Bangalore
    Posts
    95
    Vote Rating
    1
    Rameshlamani is on a distinguished road

      0  

    Default


    Thank you. Helpful

  4. #4