2014-02-10 29 views
1

我在网页中使用网格面板.. 我在网格面板中添加了一个包含打印按钮的工具栏,用于打印网格视图的内容。 。 网格的布局方向是从右到左(RTL)是合适的用阿拉伯数字..如何处理在ext.net中打印网格面板的方向

但是当我在按钮按下(印刷)的网格方向从左至右,这是出现不正确..

< ext:按钮ID =“btnPrintPageGrid”runat =“server”Text =“打印机打印机”Icon =“打印机“Handler =”this.up('grid')。print({currentPageOnly:true});“ />

我搜索任何选项添加到按钮的功能,但我没有找到,我也试图添加(RTL:真),但它不工作...

任何帮助?

回答

1

我用于打印毫秒报告查看器和推荐你。 在aspx页面上做出定性报告,并在弹出窗口的框架中显示它。 有对齐问题不会发生。

或者将报告生成为html并将其插入到框架中。 这里是工作示例:这里http://jsfiddle.net/D4K3E/1/, 是代码:

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

+0

谢谢老兄您的回复,我来试试,并告诉你结果。 :) – haytham