Modify Output Of PDF Report

char01
Tera Contributor

Hi all 

 

I am looking for a way to remove the data on the PDF report export when I select export PDF. I did like to remove some specific information on the report. For example, if I am on the incident form and I open the form and select the hamburger icon > export > pdf

 

 

When I open the report, I did like the fields highlighted in red removed .

char01_1-1711342328377.png

Please note the existing functionality should remain in place, I did like to create a new button name "Incident Print" to carry out this new function on the incident form 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@char01 

check these 2 links and see if that works; if not then use below approach I shared. You cannot possibly remove the Run by but you can remove the red fields

Remove extra details from the PDF report export 

How to modify or remove the table details on the exported PDF 

For that you create a new view similar to above and remove those 2 red fields and in your button have this script and mention the view name

1) UI action to be client side something similar to this and script as this

AnkurBawiskar_0-1711348197287.png

 

function printPDF(){
	var uri = g_form.getTableName() + '.do?sys_id=' + g_form.getUniqueValue() + '&sysparm_view=yourViewName&PDF';
	g_navigation.open(uri);
}

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

char01
Tera Contributor

hello 

 

I only want this button to appear on my new view and not the incident view, is the above script going to work for that