2017-04-06 145 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页面。 –