2017-04-06 142 views
-1

我想知道如果打印選項在sap fiori應用程序中可用嗎?如果是這樣,它只在桌面上還是手機上?如果您可以請發佈代碼示例,我將不勝感激。在Sap Fiori中打印

感謝您的幫助。

回答

-1

通過使用javascript構建HTML,您可以在SAPUI5應用程序中創建打印。它將在桌面和手機上。

var temp = this.getView().getModel(); 
     console.log(temp); 
     var nameofWork = 
      "A variable object is an abstract concept." + 
      "In different context types, physically, it’s presented" + 
      " using different object. For example, in the global context" + 
      " the variable object is the global object itself (that’s why we have an ability to refer global variables via property names of the global object)."; 
     var mainView = "<html><body><div><h2>Name of work:</h2><div><p>" + nameofWork + "</p></div></div>"; 

     mainView += "</body></html>"; 
     var ctrlString = "width=600px,height=600px"; 
     sap.ui.core.BusyIndicator.hide(); 
     var wind = window.open("", "PrintWindow", ctrlString); 
     wind.document.write(mainView); 
     wind.print(); 
     wind.close(); 
+0

感謝您的回覆。 有關打開方法,第二個參數「PrintWindow」是我必須創建的對話框? –

+0

不需要它會自動創建,只需要根據您的要求構建html頁面。 –