Question

I'm using a grid panel in my web page .. i added a toolbar contains printing button in the grid panel to print the content of the grid view .. the layout direction of the grid is from Right to Left (RTL) to be suitable with arabic ..

but when i press on the button (print) the grid direction appeared from left to right , which is not correct ..

< ext:Button ID="btnPrintPageGrid" runat="server" Text="طباعة الصفحة الحالية فقط" Icon="Printer" Handler="this.up('grid').print({currentPageOnly : true });" />

i searched for any option to add to the functionality of the button , but i didn't find, also i tried to add (rtl : true) , but it doesn't work...

Any help ???

Was it helpful?

Solution

I use for printing ms report viewer and recommend you. Make a qualitative report on the aspx page and show it in a frame in the pop up window. And there is alignment problems do not happen.

Or build report as html and also insert it into the frame. Here is working sample: http://jsfiddle.net/D4K3E/1/, here is the code:

ShowPrintWindow = function (frameUrl, title, width, height, hidePrintButton) {
    height = height ? height : 509;
    width = width ? width : 675;
    if (typeof (title) == 'undefined') title = 'Печать';
    var win = Ext.create('Ext.window.Window', {
        id: 'printWindow',
        width: width,
        height: height,
        autoDestroy: true,
        title: title,
        iconCls: 'icon-printer',
        modal: true,
        items: [{
            border: false,
            html: '<iframe id="printFrame" src="' + 
            frameUrl + 
            '" width="' + 
            (width - 12) + 
            '" height="' + 
            (height - 61) + 
            '" frameborder="0"></iframe>'
        }],
        layout: 'fit',
        buttons: [{
            iconCls: 'icon-printer',
            text: 'Print',
            hidden: hidePrintButton ? true : false,
            listeners: {
                click: {
                    fn: function (item, e) {
                        printIframe('printFrame');
                    }
                }
            }
        }, {
            text: 'Close',
            listeners: {
                click: {
                    fn: function (item, e) {
                        Ext.getCmp('printWindow').close();
                    }
                }
            }
        }]
    }).show();
};

function printIframe(id) {
    var iframe = document.frames ? document.frames[id] : document.getElementById(id);
    var ifWin = iframe.contentWindow || iframe;
    iframe.focus();
    ifWin.print();
    return false;
}

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top