Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding a Print Button to a Page
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Adding a Print Button to a Page
 Login/Join
 
Member
posted
Is there a way to add a Print button to a container's toolbar options in Page Designer?

This message has been edited. Last edited by: FP Mod Chuck,


Application Edition
SQL Server
 
Posts: 14 | Registered: June 13, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Assuming you're on 8.2xx, yes, you can use JS and CSS to add functions like print, email et cetera. I don't have sample code but someone out there might have it.

There's helpful doc here:
..\config\web_resource\doc\automation\index.html

This message has been edited. Last edited by: BabakNYC,


WebFOCUS 8206, Unix, Windows
 
Posts: 1821 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
Try adding this for starters:
<input type="button" value="Print this page" onClick="window.print()">
 
Posts: 3066 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Guru
posted Hide Post
This might be an overkill but, here's what I did for my page, you add a class (custom1) to a panel (myPanel) and reference the class in JS as shown below and add icons using font awesome icons (fa fa-exl) you can look up for other icons if you like, and finally you add an event listener.
 
window.addEventListener("iba_pageloading", function (e){
    var page = e.data;
    var myPanel = document.querySelector(".custom1").ibaObject;
    var ibsite = myPanel.addButton({"glyphClasses": "fa fa-question", "class": "ibButton", "tooltip": "Help using this application"}, ".pd-container-title-button-resize", true);
    var btnExl = myPanel.addButton({"glyphClasses": "fa fa-file-excel-o", "class": "ibButton", "tooltip": "Excel Dowload"}, ".pd-container-title-button-resize", true);
    var btnPDF  = myPanel.addButton({"glyphClasses": "fa fa-file-pdf-o", "class": "ibButton", "tooltip": "PDF Download"}, ".pd-container-title-button-resize", true);
    var btnPrint  = atmPanel.addButton({"glyphClasses": "fa fa-print", "class": "ibButton", "tooltip": "Print"}, ".pd-container-title-button-resize", true);
    ibsite.addEventListener("click", function(){
        window.open("http://www.ibi.com");
    });
    btnPrint.addEventListener("click", function(){
        window.Print();
    });
    

    page.element().addEventListener("iba_beforecontentload", function (e){
        var loadInfo = e.data;
        var path = loadInfo.path; // The path to the content being described
        var defaultValues = loadInfo.defaultValues; // If default values are used to run the content
        // e.preventDefault() will stop the page from retrieving the content
        
        // use a try/catch block, to avoid errors
        try {
            // sortvaldd is the class name of my dropdown list
            var zipcode = document.querySelector(".zip").children[0].children[1].children[0];
            // tabcont1 is the class name of my dropdown 
            var zip = zipcode.value;
            var url = '../ibi_apps/wfirs/ibfs/WFC/Repository/COE/USB_Locations/USB_Branch_Report.fex'  ;
            url = url + '?ZIPCODE=' + zip ;
            exl.addEventListener("click", function(){
            url = url + '&FMT=XLSX' ;
            window.open(url) ;
            });
            atmPDF.addEventListener("click", function(){
            var r = Math.random();
            urlPDF = '../ibi_apps/wfirs/ibfs/WFC/Repository/COE/USB_Locations/USB_ATM_Report.fex' ;
            urlPDF = urlPDF + '&FMT=PDF' + '&r=' + r;
            window.open(urlPDF) ;
            });
            
        }
        catch(err) {
          // do nothing
        }
    });
});
 


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 262 | Location: Houston,TX | Registered: June 11, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding a Print Button to a Page

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.