How do i break page between two topics

pramn
Tera Guru

How do i break page between two topics 

pramn_0-1670430238835.png

Prier NCNTS Events  comes in different page 

12 REPLIES 12

jaheerhattiwale
Mega Sage
Mega Sage

@pramn How you are exporting it?

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

once we click over to PDF (UI action ) it will get downloaded .we want to make the changes in PDF 

we want to separate page topic wise .. 

@pramn When you click on PDF button what code you are using to generate the pdf? To fix the issue we must know that so.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

html += '</table>';

new GenerateAndAttachPDF().removeDuplicateAttachments(current.sys_id + '', current.number + ''); //Remove old PDF if it has previously been generated
new GenerateAndAttachPDF().createPDF(html, 'u_exception_request', current.sys_id + '', current.number + ''); //Create new PDF and attach it to the record

/*Added this code to auto-download the file starts - NCNTS 587*/
var alreadyAttach = new GlideRecord("sys_attachment");
alreadyAttach.addQuery("table_sys_id", current.sys_id + '');
alreadyAttach.addQuery("file_name", current.number + '');
alreadyAttach.query();
if (alreadyAttach.next()) {
action.setRedirectURL(gs.getProperty("glide.servlet.uri") + 'sys_attachment.do?sys_id=' + alreadyAttach.sys_id + '&sysparm_this_url=u_exception_request.do?sys_id=' + current.sys_id + '&sysparm_domain=null&sysparm_domain_scope=null&sysparm_record_list=ORDERBYDESCsys_created_on&sysparm_record_row=1&sysparm_record_rows=925&sysparm_view=');
}
/*Added this code to auto-download the file ends*/

//action.setRedirectURL(current); //OnClick of UI Action we want to return to current record, user collects PDF from there. //commented this line for NCNTS-587

// function ncntsExportExceptionPDF() {
// //The original PDF Export, uses a view and just the inbuilt pdf exporter (same as right click -> export pdf)
// //Client callable UI action, just add function name to OnClick
// var t = g_form.getTableName();
// var v = 'pdf';
// var r = g_form.getUniqueValue().toString();
// var url = t + '.do?PDF&sys_id=' + r + '&sysparm_view=' + v;
// window.open(url);
// }