2014-02-10 25 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