Print a page in the Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 10:07 PM
Hi all,
The requirement is to print the output diagnostic page of my portal, but I'm not getting the desired output. Please find below the HTML and Client Script and the sample output.
HTML Code:
<button ng-if='data.state == "completed"'class="btn-primary button3" class="button3"ng-click="printPart()">${Download results (PDF)}</button>
Client Script:
$scope.printPart = function() {
var unprintableDiv = document.getElementById('uncontent');
unprintableDiv.style.visibility = 'hidden';
unprintableDiv.style.position = 'absolute';
var printableDiv = document.getElementById('content');
printableDiv.style.display = 'block';
var additionalHideClasses = ['digico-footer-wrapper', 'bt-footer-curve'];
additionalHideClasses.forEach(function(className) {
var elementsToHide = document.getElementsByClassName(className);
for (var i = 0; i < elementsToHide.length; i++) {
elementsToHide[i].style.display = 'none';
}
});
Output I'm getting through this code:
My requirement is to remove the "Download full results" and the line above and Download results (PDF) button.
Any leads, please do let me know.
Best Regards,
Sreesh Surendran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 03:37 AM
is that the complete client script?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 04:04 AM
Hi @sreeshsurendran ,
If you want to remove the "Download full results" and the line above and Download results (PDF) button, can you please send me your HTML code may be there is <hr> tag may be there by which the line is coming and there is one more button may be called Download full results you can remove that code from HTML may be this will work. May be you can send me your HTML code I'll try to fix that
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak