Skip to Content
0
Oct 14, 2021 at 02:47 PM

SAP UI5 - Print page

172 Views

Hello Community,

I am using following function to print:

let oTarget = this.getView()

if (oTarget) {

let $domTarget = oTarget.$()[0],

sTargetContent = $domTarget.innerHTML,

sOriginalContent = document.body.innerHTML

document.body.innerHTML = sTargetContent

window.print()

document.body.innerHTML = sOriginalContent

} else {

jQuery.sap.log.error("onPrint needs a valid target container [view|data:targetId=\"SID\"]")

}

But after printing the page doesn't have any interaction.

Does anybody has solution on this topic?