How to add button in UI page

nikhil_001
Tera Contributor

Hi Team,

 

I have build a UI page that is getting data from multiple tables based on our clients requirement but now we want to add one custom button on UI page to generate PDF.(this should covert our Ui Page to PDF).

 

Let me know if anyone have configured something like this.

 

Thanks in Advance !

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@nikhil_001 

you can add a button, but converting that UI page to PDF you need to check PDFGeneration API

PDFGenerationAPI - Scoped, Global 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you for your response. So in UI page client script i need to use this PDGeneration API.??

I wanted to know how can we use this in UI page

@Ankur Bawiskar ,I tried below script in UI page client script:

function print() {
var dialog = new GwtPollDialog('/pmo_status_2.do?'JSON.stringify(null), 0'''whtpexport');
    dialog.on('beforeclose'function() {
        window.setTimeout(function() {
            $j('.download-report').focus();
        }, 100);
    });
    dialog.execute();
}
its working fine but the problem is PDF UI is different from the UI of my UI page.
below is snap of PDF file
nikhil_001_0-1695885833583.png

while my UI page looks like below:

nikhil_001_1-1695886024938.png

How can PDF file can looks same as UI page?